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: json.loads() returns str instead of unicode for empty strings
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: ceronman, ezio.melotti, python-dev
Priority: high Keywords: patch

Created on 2011-05-03 01:35 by ceronman, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue11982.diff ezio.melotti, 2011-05-03 19:18 Patch against 2.7. review
Messages (5)
msg135014 - (view) Author: Manuel Cerón (ceronman) Date: 2011-05-03 01:35
Python 2.7.1:

>>> import json
>>> json.loads('"hello"')
u'hello'
>>> .json.loads('""')
''

Related: issue 10038
msg135061 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-05-03 19:18
Attached patch should fix the problem.
msg135120 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-04 11:41
New changeset 9d5a50e5d8a2 by Ezio Melotti in branch '2.7':
#11982: fix json.loads('""') to return u'' rather than ''.
http://hg.python.org/cpython/rev/9d5a50e5d8a2
msg135121 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-05-04 11:46
Fixed, thanks for the report!
msg135127 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-04 12:28
New changeset d3bd384df8ca by Ezio Melotti in branch '2.7':
#11982: remove now unused function.
http://hg.python.org/cpython/rev/d3bd384df8ca
History
Date User Action Args
2022-04-11 14:57:16adminsetgithub: 56191
2011-05-04 12:28:45python-devsetmessages: + msg135127
2011-05-04 11:46:31ezio.melottisetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg135121

stage: resolved
2011-05-04 11:41:40python-devsetnosy: + python-dev
messages: + msg135120
2011-05-03 19:50:20rhettingersetresolution: accepted
2011-05-03 19:18:10ezio.melottisetfiles: + issue11982.diff
keywords: + patch
messages: + msg135061
2011-05-03 18:22:45rhettingersetpriority: normal -> high
2011-05-03 17:54:38ezio.melottisetassignee: ezio.melotti

nosy: + ezio.melotti
2011-05-03 01:35:29ceronmancreate