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
31802d09
Commit
31802d09
authored
Oct 18, 2009
by
Ronald Oussoren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for issue 7149: a regression in 2.6.3 that causes an exception when
trying to detect proxy settings on OSX.
parent
9039b83c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
Lib/urllib.py
Lib/urllib.py
+9
-2
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/urllib.py
View file @
31802d09
...
...
@@ -1340,6 +1340,8 @@ if sys.platform == 'darwin':
import
socket
from
fnmatch
import
fnmatch
hostonly
,
port
=
splitport
(
host
)
def
ip2num
(
ipAddr
):
parts
=
ipAddr
.
split
(
'.'
)
parts
=
map
(
int
,
parts
)
...
...
@@ -1354,6 +1356,8 @@ if sys.platform == 'darwin':
if
proxy_settings
[
'exclude_simple'
]:
return
True
hostIP
=
None
for
value
in
proxy_settings
.
get
(
'exceptions'
,
()):
# Items in the list are strings like these: *.local, 169.254/16
if
not
value
:
continue
...
...
@@ -1361,8 +1365,11 @@ if sys.platform == 'darwin':
m
=
re
.
match
(
r"(\
d+(?:
\.\
d+)*)(/
\d+)?"
,
value
)
if
m
is
not
None
:
if
hostIP
is
None
:
hostIP
=
socket
.
gethostbyname
(
host
)
try
:
hostIP
=
socket
.
gethostbyname
(
hostonly
)
hostIP
=
ip2num
(
hostIP
)
except
socket
.
error
:
continue
base
=
ip2num
(
m
.
group
(
1
))
mask
=
int
(
m
.
group
(
2
)[
1
:])
...
...
Misc/NEWS
View file @
31802d09
...
...
@@ -411,6 +411,8 @@ Core and Builtins
Library
-------
- Issue #7149: urllib fails on OSX in the proxy detection code
- Issue #7069: Make inspect.isabstract() return a boolean.
- Add support to the `ihooks` module for relative imports.
...
...
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