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
errno not being set #49562
Comments
def test_leaking_fds_on_error(self):
# see bug python/cpython#49429: Popen leaks file descriptors to PIPEs if
# the child fails to execute; this will eventually exhaust
# the maximum number of open fds. 1024 seems a very common
# value for that limit, but Windows has 2048, so we loop
# 1024 times (each call leaked two fds).
for i in range(1024):
try:
subprocess.Popen(['nonexisting_i_hope'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
# Windows raises IOError
except (IOError, OSError) as err:
self.assertEqual(err.errno, 2) This test is failing in py3k because errno is not being set on the |
The problem is in os.py. This patch fixes it: Index: Lib/os.py --- Lib/os.py (Revision 69769)
+++ Lib/os.py (Arbeitskopie)
@@ -372,8 +372,8 @@
saved_exc = e
saved_tb = tb
if saved_exc:
- raise error(saved_exc).with_traceback(saved_tb)
- raise error(last_exc).with_traceback(tb)
+ raise saved_exc.with_traceback(saved_tb)
+ raise last_exc.with_traceback(tb) I suspect there may be other instances of this problem (I guess 2to3 |
Thanks for the diagnostic, Georg! Fixed in r69794. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: