[issue9301] urllib.quote(None) returns None in 2.7 (raised TypeError before)

Dirkjan Ochtman report at bugs.python.org
Mon Jul 19 11:09:48 CEST 2010


New submission from Dirkjan Ochtman <dirkjan at ochtman.nl>:

Rejecting invalid input seems better in this case. This was changed in issue1285086. Can we preface the normal fast path with something like:

    if s is None:
        raise TypeError('can only quote strings')

It used to raise:

    Traceback (most recent call last):
      File "/usr/lib64/python2.6/urllib.py", line 1222, in quote
        res = map(safe_map.__getitem__, s)
    TypeError: argument 2 to map() must support iteration

----------
components: Library (Lib)
messages: 110723
nosy: djc, flox, orsenthil
priority: normal
severity: normal
status: open
title: urllib.quote(None) returns None in 2.7 (raised TypeError before)
versions: Python 2.7

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


More information about the Python-bugs-list mailing list