Skip to content

fix_metaclass broken #48655

Closed
Closed

Description

@loewis
mannequin
BPO 4405
Nosy @loewis, @birkenfeld, @benjaminp

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 = 'https://github.com/benjaminp'
closed_at = <Date 2008-11-24.22:02:13.675>
created_at = <Date 2008-11-24.09:02:04.800>
labels = ['expert-2to3']
title = 'fix_metaclass broken'
updated_at = <Date 2008-11-24.22:02:13.673>
user = 'https://github.com/loewis'

bugs.python.org fields:

activity = <Date 2008-11-24.22:02:13.673>
actor = 'benjamin.peterson'
assignee = 'benjamin.peterson'
closed = True
closed_date = <Date 2008-11-24.22:02:13.675>
closer = 'benjamin.peterson'
components = ['2to3 (2.x to 3.x conversion tool)']
creation = <Date 2008-11-24.09:02:04.800>
creator = 'loewis'
dependencies = []
files = []
hgrepos = []
issue_num = 4405
keywords = []
message_count = 4.0
messages = ['76311', '76338', '76365', '76367']
nosy_count = 3.0
nosy_names = ['loewis', 'georg.brandl', 'benjamin.peterson']
pr_nums = []
priority = 'high'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue4405'
versions = ['Python 3.0']

Activity

  1. loewis commented on Nov 24, 2008

    loewismannequin
    MannequinAuthor

    When trying to run 2to3 on Django, I get a traceback

    File "/tmp/py3/lib/python3.0/lib2to3/refactor.py", line 260, in
    refactor_string
    self.refactor_tree(tree, name)
    File "/tmp/py3/lib/python3.0/lib2to3/refactor.py", line 299, in
    refactor_tree
    self.traverse_by(self.post_order, tree.post_order())
    File "/tmp/py3/lib/python3.0/lib2to3/refactor.py", line 323, in
    traverse_by
    new = fixer.transform(node, results)
    File "/tmp/py3/lib/python3.0/lib2to3/fixes/fix_metaclass.py", line
    156, in transform
    for suite, i, stmt in find_metas(node):
    File "/tmp/py3/lib/python3.0/lib2to3/fixes/fix_metaclass.py", line
    114, in find_metas
    if leaf_node.value == '__metaclass__':
    AttributeError: 'Node' object has no attribute 'value'

    The smallest example reproducing this is

    class Model(object):
        __metaclass__ = ModelBase
        save.alters_data = True
  2. self-assigned this
    on Nov 24, 2008
  3. birkenfeld commented on Nov 24, 2008

    @birkenfeld
    Member

    Are you sure you run the latest 2to3? I ran it over docutils last night,
    and while the version distributed with 2.6 failed with the same
    exception, the current 2to3 from the sandbox worked.

  4. loewis commented on Nov 24, 2008

    loewismannequin
    MannequinAuthor

    Are you sure you run the latest 2to3? I ran it over docutils last night,
    and while the version distributed with 2.6 failed with the same
    exception, the current 2to3 from the sandbox worked.

    I was using the one included in the py3k branch (in r67369), which goes
    up to r66985 from the 2to3 project.

  5. benjaminp commented on Nov 24, 2008

    @benjaminp
    Contributor

    Fixed in r67371.

  6. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions