Message170361
argparse.add_argument replaces dashes with underscores. If an argument contains another non alphanum character, accessing to it will result to a syntax error.
#! /usr/bin/env python
import argparse
if __name__ == '__main__':
argParser = argparse.ArgumentParser()
argParser.add_argument('--foo+', action='store_true')
arguments = argParser.parse_args()
print 'getattr foo+: %s' % getattr(arguments, 'foo+') # ok
print arguments.foo+ # syntax error
The patch replaces every non alnum character with an underscore. |
|
Date |
User |
Action |
Args |
2012-09-12 09:00:57 | brmzkw | set | recipients:
+ brmzkw |
2012-09-12 09:00:57 | brmzkw | set | messageid: <1347440457.56.0.780058714044.issue15929@psf.upfronthosting.co.za> |
2012-09-12 09:00:36 | brmzkw | link | issue15929 messages |
2012-09-12 09:00:36 | brmzkw | create | |
|