Hi,
I get following warning with a python script:
optparse.py:668 : FutureWarning: %u/%o/%x/%X of negative int will
return a signed string in Python 2.4 and up
my code:
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_opti on('-G','--green',action= 'store_const', const=
'#00FF00' , dest='color',
default='#80808 0',
help='life is so green')
parser.add_opti on('-R','--red',action= 'store_const', const =
'#FF0000' , dest='color',
help='I just see red')
# add more elaborated command line parsing and help text here
(options,argv) = parser.parse_ar gs()
print 'options',optio ns
I assume python wants to tell me that newer version will behave
differently for numeric arguments
What I wonder is: Why do I get the warning if my code doesn't try to
parse any numbers?
Is there any way to get rid of the warning without having to change
the python version?
(I noticed, the warning disappears if I remove the line printing
options)
thanks for any explanations. suggestions
H
I get following warning with a python script:
optparse.py:668 : FutureWarning: %u/%o/%x/%X of negative int will
return a signed string in Python 2.4 and up
my code:
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
parser.add_opti on('-G','--green',action= 'store_const', const=
'#00FF00' , dest='color',
default='#80808 0',
help='life is so green')
parser.add_opti on('-R','--red',action= 'store_const', const =
'#FF0000' , dest='color',
help='I just see red')
# add more elaborated command line parsing and help text here
(options,argv) = parser.parse_ar gs()
print 'options',optio ns
I assume python wants to tell me that newer version will behave
differently for numeric arguments
What I wonder is: Why do I get the warning if my code doesn't try to
parse any numbers?
Is there any way to get rid of the warning without having to change
the python version?
(I noticed, the warning disappears if I remove the line printing
options)
thanks for any explanations. suggestions
H
Comment