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
7d84055e
Commit
7d84055e
authored
Jun 23, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More old urllib usage.
parent
029986af
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
Tools/faqwiz/faqwiz.py
Tools/faqwiz/faqwiz.py
+4
-4
Tools/versioncheck/pyversioncheck.py
Tools/versioncheck/pyversioncheck.py
+2
-2
Tools/webchecker/webchecker.py
Tools/webchecker/webchecker.py
+8
-8
Tools/webchecker/websucker.py
Tools/webchecker/websucker.py
+5
-5
No files found.
Tools/faqwiz/faqwiz.py
View file @
7d84055e
...
...
@@ -138,8 +138,8 @@ def load_my_cookie():
value = cookies[COOKIE_NAME]
except KeyError:
return {}
import urllib
value = urllib.unquote(value)
import urllib
.parse
value = urllib.
parse.
unquote(value)
words = value.split('
/
')
while len(words) < 3:
words.append('')
...
...
@@ -153,8 +153,8 @@ def load_my_cookie():
def send_my_cookie(ui):
name = COOKIE_NAME
value = "%s/%s/%s" % (ui.author, ui.email, ui.password)
import urllib
value = urllib.quote(value)
import urllib
.parse
value = urllib.
parse.
quote(value)
then = now + COOKIE_LIFETIME
gmt = time.gmtime(then)
path = os.environ.get('
SCRIPT_NAME
', '
/
cgi
-
bin
/
')
...
...
Tools/versioncheck/pyversioncheck.py
View file @
7d84055e
"""pyversioncheck - Module to help with checking versions"""
import
urllib
import
urllib
.request
import
email
import
sys
...
...
@@ -47,7 +47,7 @@ def _check1version(package, url, version, verbose=0):
if
verbose
>=
VERBOSE_EACHFILE
:
print
(
' Checking %s'
%
url
)
try
:
fp
=
urllib
.
urlopen
(
url
)
fp
=
urllib
.
request
.
urlopen
(
url
)
except
IOError
as
arg
:
if
verbose
>=
VERBOSE_EACHFILE
:
print
(
' Cannot open:'
,
arg
)
...
...
Tools/webchecker/webchecker.py
View file @
7d84055e
...
...
@@ -113,13 +113,13 @@ import io
import
getopt
import
pickle
import
urllib
import
urlparse
import
urllib
.request
import
url
lib.parse
as
url
parse
import
sgmllib
import
cgi
import
mimetypes
import
robotparser
from
urllib
import
robotparser
# Extract real version number if necessary
if
__version__
[
0
]
==
'$'
:
...
...
@@ -487,7 +487,7 @@ class Checker:
if
url
in
self
.
name_table
:
return
self
.
name_table
[
url
]
scheme
,
path
=
urllib
.
splittype
(
url
)
scheme
,
path
=
urllib
.
request
.
splittype
(
url
)
if
scheme
in
(
'mailto'
,
'news'
,
'javascript'
,
'telnet'
):
self
.
note
(
1
,
" Not checking %s URL"
%
scheme
)
return
None
...
...
@@ -733,13 +733,13 @@ class MyStringIO(io.StringIO):
return
self
.
__url
class
MyURLopener
(
urllib
.
FancyURLopener
):
class
MyURLopener
(
urllib
.
request
.
FancyURLopener
):
http_error_default
=
urllib
.
URLopener
.
http_error_default
http_error_default
=
urllib
.
request
.
URLopener
.
http_error_default
def
__init__
(
*
args
):
self
=
args
[
0
]
urllib
.
FancyURLopener
.
__init__
(
*
args
)
urllib
.
request
.
FancyURLopener
.
__init__
(
*
args
)
self
.
addheaders
=
[
(
'User-agent'
,
'Python-webchecker/%s'
%
__version__
),
]
...
...
@@ -769,7 +769,7 @@ class MyURLopener(urllib.FancyURLopener):
s
.
write
(
'<A HREF="%s">%s</A>
\
n
'
%
(
q
,
q
))
s
.
seek
(
0
)
return
s
return
urllib
.
FancyURLopener
.
open_file
(
self
,
url
)
return
urllib
.
request
.
FancyURLopener
.
open_file
(
self
,
url
)
class
MyHTMLParser
(
sgmllib
.
SGMLParser
):
...
...
Tools/webchecker/websucker.py
View file @
7d84055e
...
...
@@ -6,8 +6,8 @@ __version__ = "$Revision$"
import
os
import
sys
import
urllib
import
getopt
import
urllib.parse
import
webchecker
...
...
@@ -87,11 +87,11 @@ class Sucker(webchecker.Checker):
self
.
message
(
"didn't save %s: %s"
,
path
,
str
(
msg
))
def
savefilename
(
self
,
url
):
type
,
rest
=
urllib
.
splittype
(
url
)
host
,
path
=
urllib
.
splithost
(
rest
)
type
,
rest
=
urllib
.
parse
.
splittype
(
url
)
host
,
path
=
urllib
.
parse
.
splithost
(
rest
)
path
=
path
.
lstrip
(
"/"
)
user
,
host
=
urllib
.
splituser
(
host
)
host
,
port
=
urllib
.
splitnport
(
host
)
user
,
host
=
urllib
.
parse
.
splituser
(
host
)
host
,
port
=
urllib
.
parse
.
splitnport
(
host
)
host
=
host
.
lower
()
if
not
path
or
path
[
-
1
]
==
"/"
:
path
=
path
+
"index.html"
...
...
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