add a argparse.py (from py 3.2.6) that is not broken

also: remove previois attempt to fix this, installing pypi argparse into virtualenv does not work.
This commit is contained in:
Thomas Waldmann 2015-09-13 00:58:57 +02:00
parent 7774d4f82c
commit 2b311846e0
4 changed files with 2403 additions and 8 deletions

View file

@ -1,4 +1,6 @@
import argparse
from .support import argparse # see support/__init__.py docstring
# DEPRECATED - remove after requiring py 3.4
from binascii import hexlify
from datetime import datetime
from operator import attrgetter

16
borg/support/__init__.py Normal file
View file

@ -0,0 +1,16 @@
"""
3rd party stuff that needed fixing
Note: linux package maintainers feel free to remove any of these hacks
IF your python version is not affected.
argparse is broken with default args (double conversion):
affects: 3.2.0 <= python < 3.2.4
affects: 3.3.0 <= python < 3.3.1
as we still support 3.2 and 3.3 there is no other way than to bundle
a fixed version (I just took argparse.py from 3.2.6) and import it from
here (see import in archiver.py).
DEPRECATED - remove support.argparse after requiring python 3.4.
"""

2383
borg/support/argparse.py Normal file

File diff suppressed because it is too large Load diff

View file

@ -14,12 +14,6 @@ if my_python < min_python:
# Also, we might use some rather recent API features.
install_requires=['msgpack-python>=0.4.6', ]
if (my_python < (3, 2, 4) or
(3, 3, 0) <= my_python < (3, 3, 1)):
# argparse in stdlib does not work there due to a bug,
# pull a fixed argparse from pypi
install_requires.append("argparse>=1.4.0")
from setuptools import setup, Extension
from setuptools.command.sdist import sdist
@ -161,7 +155,7 @@ setup(
'Topic :: Security :: Cryptography',
'Topic :: System :: Archiving :: Backup',
],
packages=['borg', 'borg.testsuite'],
packages=['borg', 'borg.testsuite', 'borg.support', ],
entry_points={
'console_scripts': [
'borg = borg.archiver:main',