We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = None closed_at = <Date 2019-01-15.11:26:19.488> created_at = <Date 2019-01-15.10:18:35.099> labels = ['interpreter-core', '3.7', 'invalid'] title = 'Broken "Exception ignored in:" message on OSError\'s' updated_at = <Date 2019-01-15.11:26:58.181> user = 'https://github.com/salty-horse'
bugs.python.org fields:
activity = <Date 2019-01-15.11:26:58.181> actor = 'vstinner' assignee = 'none' closed = True closed_date = <Date 2019-01-15.11:26:19.488> closer = 'salty-horse' components = ['Interpreter Core'] creation = <Date 2019-01-15.10:18:35.099> creator = 'salty-horse' dependencies = [] files = [] hgrepos = [] issue_num = 35743 keywords = [] message_count = 4.0 messages = ['333661', '333672', '333676', '333679'] nosy_count = 2.0 nosy_names = ['salty-horse', 'vstinner'] pr_nums = [] priority = 'normal' resolution = 'not a bug' stage = 'resolved' status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue35743' versions = ['Python 3.6', 'Python 3.7']
The text was updated successfully, but these errors were encountered:
When an OSError exception is raised in __del__, both Python 2 and 3 print the "Exception ignored" message, but Python 3 also prints a traceback.
This is similar to bpo-22836, with dealt with errors in __repr__ while inside __del__.
Test script:
import os class Obj(object): def __init__(self): self.f = open('/dev/null') os.close(self.f.fileno()) def __del__(self): self.f.close() f = Obj() del f
Output with Python 3.7.2:
Exception ignored in: <function Obj.__del__ at 0x7fb18789be18> Traceback (most recent call last): File "/tmp/test.py", line 9, in __del__ self.f.close() OSError: [Errno 9] Bad file descriptor
Sorry, something went wrong.
Python works as expected, I don't understand why you opened a bug report? What looks wrong to you?
Closing a closed file descriptor is your fault, not a bug in Python.
Python logs an error as expected.
Sorry, I was confused by how Python 3 prints the traceback of ignored exceptions, and Python 2 does not.
(This happens on on any exception and not just OSError)
It's not a bug but a nice feature which helps you to debug your code!
No branches or pull requests
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: