[issue3314] urllib.parse doesn't import sys

Matt Giuca report at bugs.python.org
Mon Jul 7 16:50:30 CEST 2008


New submission from Matt Giuca <matt.giuca at gmail.com>:

urllib.parse doesn't import sys, which is needed on line 368, in an
error condition for urlencode. This is only a problem when urlencode has
a TypeError.

Current behaviour:
>>> urllib.parse.urlencode("foo")
NameError: global name 'sys' is not defined

Desired behaviour:
>>> urllib.parse.urlencode("foo")
TypeError: not a valid non-string sequence or mapping object

Only affects Python 3.0. (After urllib module was split up).

Patch attached, for revision 64772.

Commit log:

urllib/parse.py: Added missing "import sys".

----------
components: Library (Lib)
files: parse.py.patch
keywords: patch
messages: 69389
nosy: mgiuca
severity: normal
status: open
title: urllib.parse doesn't import sys
type: compile error
versions: Python 3.0
Added file: http://bugs.python.org/file10843/parse.py.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3314>
_______________________________________


More information about the Python-bugs-list mailing list