geier / pycarddav

DEPRECATED - use vdirsyncer & khard -- easy to use CLI CardDAV client
http://lostpackets.de/pycarddav
MIT License
99 stars 35 forks source link

argparse DeprecationWarning #82

Closed brianreumere closed 10 years ago

brianreumere commented 10 years ago

This could be a result of being on Debian squeeze or something, but pc_query was giving me the following error:

/usr/lib/pymodules/python2.6/argparse.py:1576: DeprecationWarning: The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action='version', version="N", ...)" instead

This wasn't so bad because everything worked, but mutt didn't like it very much. I added the following to pycarddav/init.py, removed the version argument to ArgumentParser, reinstalled, and it's now working without a warning:

self._arg_parser.add_argument(
    "--version", action="version", version=__version__)

Edit: Sorry, meant to include the versions of dependencies:

ii  python-requests                   0.12.1-1~bpo60+1             elegant and simple HTTP library for Python, built for human beings
ii  python-vobject                    0.8.1c-3                     parse iCalendar and VCards in Python
ii  python-urwid                      0.9.9.1-1                    curses-based UI/widget library for Python
ii  python-py                         1.3.3-2                      Advanced Python testing tool and networking lib
ii  python-xdg                        0.19-2                       Python library to access freedesktop.org standards
ii  python-lxml                       2.2.8-2                      pythonic binding for the libxml2 and libxslt libraries
ii  python2.6                         2.6.6-8+b1                   An interactive high-level object-oriented language (version 2.6)
geier commented 10 years ago

thanks for reporting this bug. Should be fixed in the develop branch.

brianreumere commented 10 years ago

My pleasure. Thanks for pycarddav!