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

Message can be formatted twice in importlib #69467

Closed
serhiy-storchaka opened this issue Sep 30, 2015 · 3 comments
Closed

Message can be formatted twice in importlib #69467

serhiy-storchaka opened this issue Sep 30, 2015 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 25280
Nosy @brettcannon, @ncoghlan, @ericsnowcurrently, @serhiy-storchaka
Files
  • importlib_format_verbose_message.patch
  • 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/serhiy-storchaka'
    closed_at = <Date 2015-10-01.09:20:34.757>
    created_at = <Date 2015-09-30.13:32:17.705>
    labels = ['type-bug', 'library']
    title = 'Message can be formatted twice in importlib'
    updated_at = <Date 2015-10-01.09:20:34.756>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-10-01.09:20:34.756>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-10-01.09:20:34.757>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2015-09-30.13:32:17.705>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['40626']
    hgrepos = []
    issue_num = 25280
    keywords = ['patch']
    message_count = 3.0
    messages = ['251937', '252009', '252011']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'ncoghlan', 'python-dev', 'eric.snow', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue25280'
    versions = ['Python 3.4', 'Python 3.5', 'Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    In importlib a verbose message can be formatted twice, the first time before passing it to _verbose_message(), and the second time in _verbose_message(), Example:

    $ python -v
    ...
    >>> open('{0}.pyc', 'wb').close()
    >>> __import__('{0}')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<frozen importlib._bootstrap>", line 969, in _find_and_load
      File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 658, in exec_module
      File "<frozen importlib._bootstrap_external>", line 869, in get_code
      File "<frozen importlib._bootstrap_external>", line 440, in _validate_bytecode_header
      File "<frozen importlib._bootstrap_external>", line 368, in _verbose_message
    IndexError: tuple index out of range

    Proposed patch fixes the issue.

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Sep 30, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 1, 2015

    New changeset da42b38f7470 by Serhiy Storchaka in branch '3.4':
    Issue bpo-25280: Import trace messages emitted in verbose (-v) mode are no
    https://hg.python.org/cpython/rev/da42b38f7470

    New changeset 10c13441bf8d by Serhiy Storchaka in branch '3.5':
    Issue bpo-25280: Import trace messages emitted in verbose (-v) mode are no
    https://hg.python.org/cpython/rev/10c13441bf8d

    New changeset e377d568928b by Serhiy Storchaka in branch 'default':
    Issue bpo-25280: Import trace messages emitted in verbose (-v) mode are no
    https://hg.python.org/cpython/rev/e377d568928b

    @serhiy-storchaka
    Copy link
    Member Author

    Thank you Brett for your review.

    @serhiy-storchaka serhiy-storchaka self-assigned this Oct 1, 2015
    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant