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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
f1589378
Commit
f1589378
authored
Jul 01, 2018
by
Jason Madden
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
Hide 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:
try
:
# Python 3
from
urllib.request
import
FancyURLopener
,
URLopener
,
urlretrieve
from
urllib.request
import
urlretrieve
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
:
# Python 2
import
base64
...
...
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