This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: unquote(None) raises AttributeError - Instead of TypeError
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: flox, georg.brandl, orsenthil
Priority: normal Keywords:

Created on 2010-07-30 19:31 by orsenthil, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg112100 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-07-30 19:31
>>> from urllib.parse import unquote
>>> unquote(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/senthil/python/release31-maint/Lib/urllib/parse.py", line 331, in unquote
    res = string.split('%')
AttributeError: 'NoneType' object has no attribute 'split'

As obvious, the AttributeError above is not an Intentional one and is a mistake. TypeError is correct.

Opening this issue subsequent to the discussion in msg12098
msg112103 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-07-30 19:41
The previous hyperlink should have been: Issue9301

Fixed in revision 83294.

As this a change in Exception value, I am not sure, if backport is a good idea. If someone find change this breaks their existing setup, please comment here.
msg112122 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-07-31 09:00
IMHO we could keep AttributeError in this case.
This is a case where "practicality beats purity".
See also issue 1285086.
msg112142 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-31 11:42
I'd say keep the AttributeError too.  This is not different from many other functions that fail variously with random types fed into them.
History
Date User Action Args
2022-04-11 14:57:04adminsetgithub: 53678
2010-07-31 11:42:56georg.brandlsetstatus: open -> closed
nosy: + georg.brandl
messages: + msg112142

2010-07-31 09:01:00floxsetnosy: + flox
messages: + msg112122

components: + Library (Lib)
resolution: fixed
2010-07-30 19:41:18orsenthilsetmessages: + msg112103
stage: resolved
2010-07-30 19:31:43orsenthilcreate