New submission from Raghuram Devarakonda:

Sorry for the generic title but I couldn't think of a better one. My
attempt to do "svn up && make" failed with the following exception from
setup.py:

----------------------
File "./setup.py", line 314, in detect_modules
    if options.dirs:
AttributeError: Values instance has no attribute 'dirs'
----------------------

I isolated the problem to a small script.

----------------------
import optparse

parser = optparse.OptionParser()
parser.add_option("-I", dest="dirs", action="append")
options = parser.parse_args(['-I.', '-IInclude', '-I./Include'])[0]
if options.dirs:
    print "opt = ", options.dirs
----------------------

When run with 2.5.1, the script prints "opt =  ['.', 'Include',
'./Include']" but python from trunk gives the error:

Traceback (most recent call last):
  File "../opttest.py", line 6, in <module>
    if options.dirs:
AttributeError: Values instance has no attribute 'dirs'

----------
components: Library (Lib)
messages: 59672
nosy: draghuram
severity: normal
status: open
title: Error with OptionParser.parse_args()
type: behavior
versions: Python 2.6

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1784>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to