Merge pull request #199 from ThomasWaldmann/fix-argparse

add a argparse.py (from py 3.2.6) that is not broken
This commit is contained in:
TW 2015-09-13 01:18:59 +02:00
commit e6ccd0e259
5 changed files with 2406 additions and 9 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

View file

@ -1,4 +1,6 @@
import argparse
from .support import argparse # see support/__init__.py docstring
# DEPRECATED - remove after requiring py 3.4
import binascii
from collections import namedtuple
from functools import wraps

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',