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

Idle doesn't obey the new improved warnings arguements #48176

Closed
scottdaniels mannequin opened this issue Sep 21, 2008 · 10 comments
Closed

Idle doesn't obey the new improved warnings arguements #48176

scottdaniels mannequin opened this issue Sep 21, 2008 · 10 comments
Labels
stdlib Python modules in the Lib dir topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@scottdaniels
Copy link
Mannequin

scottdaniels mannequin commented Sep 21, 2008

BPO 3926
Nosy @amauryfa
Files
  • diff_trunk: File contains diffs for changes described above.
  • test_idle_warnings.py: Test for (most of) discovered issues.
  • parts.zip: Code and differs for Py
  • idle_fixwarnings.diff
  • 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 2009-08-14.14:03:46.052>
    created_at = <Date 2008-09-21.23:52:15.660>
    labels = ['expert-IDLE', 'type-bug', 'library']
    title = "Idle doesn't obey the new improved warnings arguements"
    updated_at = <Date 2009-08-14.15:08:03.321>
    user = 'https://bugs.python.org/scottdaniels'

    bugs.python.org fields:

    activity = <Date 2009-08-14.15:08:03.321>
    actor = 'gpolo'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-08-14.14:03:46.052>
    closer = 'gpolo'
    components = ['IDLE', 'Library (Lib)']
    creation = <Date 2008-09-21.23:52:15.660>
    creator = 'scott_daniels'
    dependencies = []
    files = ['11636', '11637', '12113', '14638']
    hgrepos = []
    issue_num = 3926
    keywords = ['patch']
    message_count = 10.0
    messages = ['73541', '73581', '73631', '73946', '73947', '76191', '76280', '91223', '91550', '91554']
    nosy_count = 3.0
    nosy_names = ['scott_daniels', 'amaury.forgeotdarc', 'gpolo']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3926'
    versions = ['Python 2.6', 'Python 3.0']

    @scottdaniels
    Copy link
    Mannequin Author

    scottdaniels mannequin commented Sep 21, 2008

    Idle doesn't accept the new improved warnings arguments, thus escalating
    warnings to failures. This is, I believe, the core reason that Idle was
    failing on windows (warnings about deprecated set_daemon call escalated
    to a failure).

    Files affected: idlelib/PyShell.py and idlelib/run.py

    On chasing this, it looks like the code in warnings.py is masking
    IOErrors a little too broadly, so we should probably also narrow the
    exception handling in warnings.py

    Patch coming, but not ready just yet.

    @scottdaniels scottdaniels mannequin added the type-bug An unexpected behavior, bug, or error label Sep 21, 2008
    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Sep 22, 2008

    The first part was already mentioned in bpo-3391, but not closing this
    in favor of the second part of your message.

    @scottdaniels
    Copy link
    Mannequin Author

    scottdaniels mannequin commented Sep 23, 2008

    I found that patch, but it confuses showwarning and formatwarning
    parameter changes.

    @scottdaniels
    Copy link
    Mannequin Author

    scottdaniels mannequin commented Sep 27, 2008

    OK, Issues:

    1. warnings.py
      I/O errors in formatwarning will be masked and misinterpreted as
      failures to write on stderr, and no output will be attempted.

    2. warnings.py
      A line with of whitespace will be shown, rather than suppressed.

    3. idlelib/PyShell.py
      idle_show_warning did not take new args to showwarning.
      & a repeat of an error much like 1.

    4. idlelib/PyShell.py
      idle_format_warning did not take new arg to formatwarning.

    5. idlelib/PyShell.py
      extended_linecache_checkcache did not pass its arg along to
      orig_checkcache. Had to rename the element in the loop to
      avoid trashing the arg.

    6. idlelib/run.py
      idle_formatwarning_subproc must also follow the new protocol for
      formatwarning.

    @scottdaniels scottdaniels mannequin added topic-IDLE stdlib Python modules in the Lib dir labels Sep 27, 2008
    @scottdaniels
    Copy link
    Mannequin Author

    scottdaniels mannequin commented Sep 27, 2008

    Here is a test for the fixes provided.

    @amauryfa
    Copy link
    Member

    This is already corrected by r66922 (bpo-3391), but the patches are
    different and there are some things I don't like in the present
    implementation:

    • in idle_showwarning, the "file" argument is ignored and always
      replaced by warning_stream.
    • warnings.formatwarning is passed a "file" argument: this could fail,
      but works only because the function is monkey-patched. But "file" is not
      even used there!

    The attached patch seems better, but does not apply cleanly any more.

    @scottdaniels
    Copy link
    Mannequin Author

    scottdaniels mannequin commented Nov 23, 2008

    Attached parts.zip -- a zip of updates for Python 2.6 and Python 3.0
    against the current source [zip has two

    For Python 2.6:
    py26/diff_py26.txt -- differ against python26-maint tree
    py26/PyShell.py -- Replacement file for .../Lib/idlelib/PyShell.py
    py26/run.py -- Replacement file for .../Lib/idlelib/run.py

    For Python 3.0:
    py30/py3k_diff.txt -- differ against python3k tree
    py30/PyShell.py -- Replacement file for .../Lib/idlelib/PyShell.py
    py30/run.py -- Replacement file for .../Lib/idlelib/run.py

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Aug 3, 2009

    This looks good Scott, I'm just attaching the .diff here with real minor
    changes and will be applying if no one is against it.

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Aug 14, 2009

    Committed on r74447, will merge into py3k.

    @gpolo gpolo mannequin closed this as completed Aug 14, 2009
    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Aug 14, 2009

    Committed on r74447, will merge into py3k.

    py3k: r74450

    @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 topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant