incorrect adaption of logging in DistutilsRefactoringTool / Python 3.1

Issue #201 resolved
Mike Bayer
created an issue

There's an adapter in the 2to3 area of build_py.py for the 2to3 RefactoringTool and its attempting to provide logging services. However, my Python 3.1.2 install is looking for a "self.log" attribute directly. Should probably provide ".log" as an attribute in the adapter here for this case.

stack trace:

{{{
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py", line 514, in refactor_doctest
tree = self.parse_block(block, lineno, indent)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py", line 563, in parse_block
return self.driver.parse_tokens(self.wrap_toks(block, lineno, indent))
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/pgen2/driver.py", line 70, in parse_tokens
if p.addtoken(type, value, (prefix, start)):
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/pgen2/parse.py", line 116, in addtoken
ilabel = self.classify(type, value, context)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/pgen2/parse.py", line 172, in classify
raise ParseError("bad token", type, value, context)
lib2to3.pgen2.parse.ParseError: bad token: type=55, value='\', context=('', (243, 67))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "setup.py", line 256, in <module>
run_setup(False)
File "setup.py", line 249, in run_setup
**kwargs
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/core.py", line 149, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/dist.py", line 919, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/dist.py", line 938, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/cmd.py", line 315, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/dist.py", line 938, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/distribute-0.6.15-py3.1.egg/setuptools/command/build_py.py", line 81, in run
self.run_2to3(self.__updated_files, True)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/distribute-0.6.15-py3.1.egg/setuptools/command/build_py.py", line 41, in run_2to3
r.refactor(files, write=True, doctests_only=True)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py", line 273, in refactor
self.refactor_file(dir_or_file, write, doctests_only)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py", line 319, in refactor_file
output = self.refactor_docstring(input, filename)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py", line 496, in refactor_docstring
indent, filename))
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/lib2to3/refactor.py", line 516, in refactor_doctest
if self.log.isEnabledFor(logging.DEBUG):
AttributeError: 'DistutilsRefactoringTool' object has no attribute 'log'

}}}

Comments (2)

  1. Log in to comment