Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0f694d72
Commit
0f694d72
authored
Dec 18, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
fb0901c9
dec36b6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
Lib/threading.py
Lib/threading.py
+4
-7
Lib/urllib/request.py
Lib/urllib/request.py
+0
-2
Misc/NEWS
Misc/NEWS
+6
-0
No files found.
Lib/threading.py
View file @
0f694d72
...
...
@@ -1047,21 +1047,18 @@ def _after_fork():
current
=
current_thread
()
with
_active_limbo_lock
:
for
thread
in
_active
.
values
():
# Any lock/condition variable may be currently locked or in an
# invalid state, so we reinitialize them.
thread
.
_reset_internal_locks
()
if
thread
is
current
:
# There is only one active thread. We reset the ident to
# its new value since it can have changed.
ident
=
get_ident
()
thread
.
_ident
=
ident
# Any condition variables hanging off of the active thread may
# be in an invalid state, so we reinitialize them.
thread
.
_reset_internal_locks
()
new_active
[
ident
]
=
thread
else
:
# All the others are already stopped.
# We don't call _Thread__stop() because it tries to acquire
# thread._Thread__block which could also have been held while
# we forked.
thread
.
_stopped
=
True
thread
.
_stop
()
_limbo
.
clear
()
_active
.
clear
()
...
...
Lib/urllib/request.py
View file @
0f694d72
...
...
@@ -1762,7 +1762,6 @@ class URLopener:
def
http_error_default
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
):
"""Default error handler: close the connection and raise IOError."""
void
=
fp
.
read
()
fp
.
close
()
raise
HTTPError
(
url
,
errcode
,
errmsg
,
headers
,
None
)
...
...
@@ -1951,7 +1950,6 @@ class FancyURLopener(URLopener):
newurl
=
headers
[
'uri'
]
else
:
return
void
=
fp
.
read
()
fp
.
close
()
# In case the server sent a relative URL, join with original:
...
...
Misc/NEWS
View file @
0f694d72
...
...
@@ -419,6 +419,12 @@ Core and Builtins
Library
-------
-
Issue
#
11870
:
threading
:
Properly
reinitialize
threads
internal
locks
and
condition
variables
to
avoid
deadlocks
in
child
processes
.
-
Issue
#
8035
:
urllib
:
Fix
a
bug
where
the
client
could
remain
stuck
after
a
redirection
or
an
error
.
-
Issue
#
13560
:
os
.
strerror
()
now
uses
the
current
locale
encoding
instead
of
UTF
-
8.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment