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

Warnings can cause application errors #37162

Closed
mhammond opened this issue Sep 11, 2002 · 3 comments
Closed

Warnings can cause application errors #37162

mhammond opened this issue Sep 11, 2002 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@mhammond
Copy link
Contributor

BPO 607668
Nosy @loewis, @mhammond
Files
  • warnings.py.patch: Proposed fix
  • 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/mhammond'
    closed_at = <Date 2002-09-11.13:23:44.000>
    created_at = <Date 2002-09-11.06:17:40.000>
    labels = ['library']
    title = 'Warnings can cause application errors'
    updated_at = <Date 2002-09-11.13:23:44.000>
    user = 'https://github.com/mhammond'

    bugs.python.org fields:

    activity = <Date 2002-09-11.13:23:44.000>
    actor = 'mhammond'
    assignee = 'mhammond'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2002-09-11.06:17:40.000>
    creator = 'mhammond'
    dependencies = []
    files = ['615']
    hgrepos = []
    issue_num = 607668
    keywords = []
    message_count = 3.0
    messages = ['12345', '12346', '12347']
    nosy_count = 2.0
    nosy_names = ['loewis', 'mhammond']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue607668'
    versions = []

    @mhammond
    Copy link
    Contributor Author

    If an application embeds Python while stderr is not
    valid, warnings can cause unexpected exceptions in the
    application. This is particularly a problem when it
    happens *while* the application is attempting to create
    a valid stderr :)

    Pythonwin recently started failing to start with the
    following traceback:

    File "f:\src\python-cvs\lib\regsub.py", line 15, in ?
    DeprecationWarning)
    File "f:\src\python-cvs\lib\warnings.py", line 45, in
    warn
    warn_explicit(message, category, filename, lineno,
    module, registry)
    File "f:\src\python-cvs\lib\warnings.py", line 104,
    in warn_explicit
    showwarning(message, category, filename, lineno)
    File "f:\src\python-cvs\lib\warnings.py", line 110,
    in showwarning
    file.write(formatwarning(message, category,
    filename, lineno))
    exceptions.IOError: (9, 'Bad file descriptor')

    I propose that the warnings module ignore IOError
    exceptions when writing the warning. Attaching
    proposed fix.

    Assigning to Martin for feedback - assign back for me
    to check in.

    @mhammond mhammond self-assigned this Sep 11, 2002
    @mhammond mhammond added the stdlib Python modules in the Lib dir label Sep 11, 2002
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Sep 11, 2002

    Logged In: YES
    user_id=21627

    Looks good, please apply it.

    @mhammond
    Copy link
    Contributor Author

    Logged In: YES
    user_id=14198

    Checking in warnings.py;
    /cvsroot/python/python/dist/src/Lib/warnings.py,v <--
    warnings.py
    new revision: 1.17; previous revision: 1.16

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 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
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant