Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2to3 throws AttributeError during distutils installation with -O #55464

Closed
scoder opened this issue Feb 20, 2011 · 3 comments
Closed

2to3 throws AttributeError during distutils installation with -O #55464

scoder opened this issue Feb 20, 2011 · 3 comments
Labels
topic-2to3 type-bug An unexpected behavior, bug, or error

Comments

@scoder
Copy link
Contributor

scoder commented Feb 20, 2011

BPO 11255
Nosy @scoder, @benjaminp, @merwok, @iritkatriel

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2021-09-09.20:52:12.184>
created_at = <Date 2011-02-20.10:28:06.983>
labels = ['type-bug', 'expert-2to3']
title = '2to3 throws AttributeError during distutils installation with -O'
updated_at = <Date 2021-09-09.20:52:12.182>
user = 'https://github.com/scoder'

bugs.python.org fields:

activity = <Date 2021-09-09.20:52:12.182>
actor = 'iritkatriel'
assignee = 'none'
closed = True
closed_date = <Date 2021-09-09.20:52:12.184>
closer = 'iritkatriel'
components = ['2to3 (2.x to 3.x conversion tool)']
creation = <Date 2011-02-20.10:28:06.983>
creator = 'scoder'
dependencies = []
files = []
hgrepos = []
issue_num = 11255
keywords = []
message_count = 3.0
messages = ['128900', '129455', '401517']
nosy_count = 4.0
nosy_names = ['scoder', 'benjamin.peterson', 'eric.araujo', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue11255'
versions = ['Python 3.1', 'Python 2.7', 'Python 3.2', 'Python 3.3']

@scoder
Copy link
Contributor Author

scoder commented Feb 20, 2011

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'

@scoder scoder added type-crash A hard crash of the interpreter, possibly with a core dump topic-2to3 labels Feb 20, 2011
@merwok
Copy link
Member

merwok commented Feb 25, 2011

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.)

@merwok merwok added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 25, 2011
@iritkatriel
Copy link
Member

Python 3.2 is out of date, and distutils and 2to3 are both deprecated.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-2to3 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants