The "version" argument to ArgumentParser is deprecated.

Bug #1134422 reported by Bruno Chareyre
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Yade
Fix Released
Undecided
Unassigned

Bug Description

What is that? (ubuntu 10.04)

me: ./yade
/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
  """instead""", DeprecationWarning)
Welcome to Yade 2013-02-26.git-e25a399

Revision history for this message
Christian Jakob (jakob-ifgt) wrote :

@Bruno: Be lucky, that your yade starts!
I get:

Traceback (most recent call last):
  File "/home/me/YADE/YADEinstalled/bins/yade-2013-02-27.git-ee85e8a", line 38, in <module>
    import argparse
ImportError: No module named argparse

Revision history for this message
Jan Stránský (honzik) wrote : Re: [Yade-dev] [Bug 1134422] Re: The "version" argument to ArgumentParser is deprecated.

Hi guys,

I have changed optparse module in yade executable (which is deprecated for
s long time) to argparse module. I thought, that argparse is present in all
python distributions, but evidently not 100%.

@Christian: sudo apt-get install python-argparse
which was already added to documentation by Anton in one of previous
commits.

@Bruno: I will have a look

sorry for the problems
Jan

2013/2/27 Christian Jakob <email address hidden>

> @Bruno: Be lucky, that your yade starts!
> I get:
>
> Traceback (most recent call last):
> File "/home/me/YADE/YADEinstalled/bins/yade-2013-02-27.git-ee85e8a",
> line 38, in <module>
> import argparse
> ImportError: No module named argparse
>
> --
> You received this bug notification because you are a member of Yade
> developers, which is subscribed to Yade.
> https://bugs.launchpad.net/bugs/1134422
>
> Title:
> The "version" argument to ArgumentParser is deprecated.
>
> Status in Yet Another Dynamic Engine:
> New
>
> Bug description:
> What is that? (ubuntu 10.04)
>
> me: ./yade
> /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
> """instead""", DeprecationWarning)
> Welcome to Yade 2013-02-26.git-e25a399
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/yade/+bug/1134422/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote :

Thanks Jan. It is a bit surprising to see a deprecation warning appear when an old module is replaced by a new one!

Revision history for this message
Jan Stránský (honzik) wrote :

The deprication warning is because of arguments of the parser.
Unfortunately the argparse module is not 100% compatible with optparse. I
will solve it today.
Jan
Dne 27.2.2013 21:25 "Bruno Chareyre" <email address hidden> napsal(a):

> Thanks Jan. It is a bit surprising to see a deprecation warning appear
> when an old module is replaced by a new one!
>
> --
> You received this bug notification because you are a member of Yade
> developers, which is subscribed to Yade.
> https://bugs.launchpad.net/bugs/1134422
>
> Title:
> The "version" argument to ArgumentParser is deprecated.
>
> Status in Yet Another Dynamic Engine:
> New
>
> Bug description:
> What is that? (ubuntu 10.04)
>
> me: ./yade
> /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
> """instead""", DeprecationWarning)
> Welcome to Yade 2013-02-26.git-e25a399
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/yade/+bug/1134422/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Jan Stránský (honzik) wrote :

Hello,

in last commit, this bug should be fixed. I removed the deprication warning
reported by Bruno and left old optparse module if argparse is not found,
reported by Christian.
I am sorry for the problems, I did not expect them while using
non-deprecated module instead of the deprecated one :-)

Please try the new version and in case of no troubles, close the bug.
Cheers
Jan

2013/2/28 Jan Stránský <email address hidden>

> The deprication warning is because of arguments of the parser.
> Unfortunately the argparse module is not 100% compatible with optparse. I
> will solve it today.
> Jan
> Dne 27.2.2013 21:25 "Bruno Chareyre" <email address hidden>
> napsal(a):
>
> Thanks Jan. It is a bit surprising to see a deprecation warning appear
>> when an old module is replaced by a new one!
>>
>> --
>> You received this bug notification because you are a member of Yade
>> developers, which is subscribed to Yade.
>> https://bugs.launchpad.net/bugs/1134422
>>
>> Title:
>> The "version" argument to ArgumentParser is deprecated.
>>
>> Status in Yet Another Dynamic Engine:
>> New
>>
>> Bug description:
>> What is that? (ubuntu 10.04)
>>
>> me: ./yade
>> /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
>> """instead""", DeprecationWarning)
>> Welcome to Yade 2013-02-26.git-e25a399
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/yade/+bug/1134422/+subscriptions
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~yade-dev
>> Post to : <email address hidden>
>> Unsubscribe : https://launchpad.net/~yade-dev
>> More help : https://help.launchpad.net/ListHelp
>>
>

Changed in yade:
status: New → Fix Released
Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote :

The last fix gives a worst situation, sorry. There original warning indeed disappears, but there is a new one, and this time the syntax highlighting disappears.
We need to be super-carefull when modifying some python stuff like this since ipython is really changing fast across versions.
Basically, every change should be tested on multiple systems.

WARNING: Configuration file ipythonrc not found. Ignoring request.
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/IPython/ConfigLoader.py", line 66, in load
    fname = filefind(fname,incpath)
  File "/usr/lib/pymodules/python2.6/IPython/genutils.py", line 555, in filefind
    ' not found in current or supplied directories:' + `alt_dirs`
IOError: File'ipythonrc' not found in current or supplied directories:u'/home/3S-LAB/bchareyre/.ipython'

Changed in yade:
status: Fix Released → Confirmed
Revision history for this message
Christian Jakob (jakob-ifgt) wrote :

> WARNING: Configuration file ipythonrc not found. Ignoring request.

This warning does not appear on debian squeeze with ipython 0.10-2

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote :

Mmmmh... Not your fault Jan it seems.
IPython0.13 killed my ipythonrc, but ipython0.10 is still looking for it.
Re-closing.

Changed in yade:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.