This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 2to3 throws AttributeError during distutils installation with -O
Type: behavior Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, eric.araujo, iritkatriel, scoder
Priority: normal Keywords:

Created on 2011-02-20 10:28 by scoder, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg128900 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2011-02-20 10:28
When running a distutils installation of Cython (which uses lib2to3) as "python3.2 -O setup.py bdist", I get this:

Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
Traceback (most recent call last):
  File "setup.py", line 319, in <module>
    **setup_args
  File "/opt/python3.2-opt/lib/python3.2/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/opt/python3.2-opt/lib/python3.2/distutils/dist.py", line 919, in run_commands
    self.run_command(cmd)
  File "/opt/python3.2-opt/lib/python3.2/distutils/dist.py", line 938, in run_command
    cmd_obj.run()
  File "/opt/python3.2-opt/lib/python3.2/distutils/command/bdist.py", line 132, in run
    self.run_command(cmd_name)
  File "/opt/python3.2-opt/lib/python3.2/distutils/cmd.py", line 315, in run_command
    self.distribution.run_command(command)
  File "/opt/python3.2-opt/lib/python3.2/distutils/dist.py", line 938, in run_command
    cmd_obj.run()
  File "/opt/python3.2-opt/lib/python3.2/distutils/command/bdist_dumb.py", line 74, in run
    self.run_command('build')
  File "/opt/python3.2-opt/lib/python3.2/distutils/cmd.py", line 315, in run_command
    self.distribution.run_command(command)
  File "/opt/python3.2-opt/lib/python3.2/distutils/dist.py", line 938, in run_command
    cmd_obj.run()
  File "/opt/python3.2-opt/lib/python3.2/distutils/command/build.py", line 128, in run
    self.run_command(cmd_name)
  File "/opt/python3.2-opt/lib/python3.2/distutils/cmd.py", line 315, in run_command
    self.distribution.run_command(command)
  File "/opt/python3.2-opt/lib/python3.2/distutils/dist.py", line 938, in run_command
    cmd_obj.run()
  File "/opt/python3.2-opt/lib/python3.2/distutils/command/build_py.py", line 404, in run
    self.run_2to3(self.updated_files)
  File "/opt/python3.2-opt/lib/python3.2/distutils/util.py", line 649, in run_2to3
    return run_2to3(files, self.fixer_names, self.options, self.explicit)
  File "/opt/python3.2-opt/lib/python3.2/distutils/util.py", line 597, in run_2to3
    r.refactor(files, write=True)
  File "/opt/python3.2-opt/lib/python3.2/lib2to3/refactor.py", line 296, in refactor
    self.refactor_file(dir_or_file, write, doctests_only)
  File "/opt/python3.2-opt/lib/python3.2/lib2to3/refactor.py", line 349, in refactor_file
    tree = self.refactor_string(input, filename)
  File "/opt/python3.2-opt/lib/python3.2/lib2to3/refactor.py", line 381, in refactor_string
    self.refactor_tree(tree, name)
  File "/opt/python3.2-opt/lib/python3.2/lib2to3/refactor.py", line 442, in refactor_tree
    find_root(node)
  File "/opt/python3.2-opt/lib/python3.2/lib2to3/fixer_util.py", line 276, in find_root
    while node.type != syms.file_input:
AttributeError: 'NoneType' object has no attribute 'type'
msg129455 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-25 22:58
This does not look specific to distutils.  Can you reproduce with bare 2to3?  If so, can you attach the test script of unit test diff? :)

(P.S. “crash” is used for segfaults, not unhandled exceptions.)
msg401517 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-09 20:52
Python 3.2 is out of date, and distutils and 2to3 are both deprecated.
History
Date User Action Args
2022-04-11 14:57:13adminsetgithub: 55464
2021-09-09 20:52:12iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg401517

resolution: out of date
stage: test needed -> resolved
2011-02-25 22:58:38eric.araujosetversions: + Python 3.1, Python 2.7, Python 3.3
nosy: + eric.araujo, benjamin.peterson

messages: + msg129455

type: crash -> behavior
stage: test needed
2011-02-20 10:28:06scodercreate