Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
f1589378
Commit
f1589378
authored
Jul 01, 2018
by
Jason Madden
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The monkey patch for urllib.request._urlopener does nothing on Python 3.
parent
a2a3dd72
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
18 deletions
+1
-18
src/zc/buildout/download.py
src/zc/buildout/download.py
+1
-18
No files found.
src/zc/buildout/download.py
View file @
f1589378
...
@@ -20,25 +20,8 @@ except ImportError:
...
@@ -20,25 +20,8 @@ except ImportError:
try
:
try
:
# Python 3
# Python 3
from
urllib.request
import
FancyURLopener
,
URLopener
,
urlretrieve
from
urllib.request
import
urlretrieve
from
urllib.parse
import
urlparse
from
urllib.parse
import
urlparse
from
urllib
import
request
import
warnings
class
PatchedURLopener
(
FancyURLopener
):
http_error_default
=
URLopener
.
http_error_default
def
__init__
(
self
,
*
args
,
**
kwargs
):
with
warnings
.
catch_warnings
():
warnings
.
simplefilter
(
'ignore'
)
# This creates a DeprecationWarning on 3.6:
# PatchedURLopener style of invoking requests is deprecated.
# Use newer urlopen functions/methods.
# Said warning breaks our doctests.
super
(
PatchedURLopener
,
self
).
__init__
(
*
args
,
**
kwargs
)
request
.
_urlopener
=
PatchedURLopener
()
# Ook! Monkey patch!
except
ImportError
:
except
ImportError
:
# Python 2
# Python 2
import
base64
import
base64
...
...
Julien Muchembled
@jm
mentioned in commit
fa0f9a92
·
Dec 27, 2021
mentioned in commit
fa0f9a92
mentioned in commit fa0f9a92d3874333ce534a84e09514af5986c2fd
Toggle commit list
Julien Muchembled
@jm
mentioned in commit
1ffd9e2f
·
Dec 27, 2021
mentioned in commit
1ffd9e2f
mentioned in commit 1ffd9e2fd52bcc9a6e52cf9f8649a6464ac912c4
Toggle commit list
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