#18457 closed Bug (fixed)
Failed test: pyyaml serializer,
Reported by: | Jonathan Paugh | Owned by: | Claude Paroz |
---|---|---|---|
Component: | Core (Serialization) | Version: | dev |
Severity: | Normal | Keywords: | unicode |
Cc: | Jonathan Paugh | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The patch introduced by commit 4a10308 causes the pyyaml deserializer to fail the test suite. The error is caused by trying to wrap a unicode string in an io.BytesIO
. The relevant bits are in tests/regressiontests/serializers_regress/tests.py
@line 408 and in django/core/serializers/pyyaml.py
@line 51.
Attachments (1)
Change History (5)
by , 12 years ago
Attachment: | 18457.diff added |
---|
comment:1 by , 12 years ago
Cc: | added |
---|---|
Has patch: | set |
Keywords: | unicode added |
comment:2 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 12 years ago
Thanks for the report. I eventually choose to handle it the same way as in json.py.
Note:
See TracTickets
for help on using tickets.
I just added a patch that fixes the bug. The problem was caused because
pyyaml.Deserializer
assumed it was dealing with abytestring
, but tested forbasestring
instead--causing it to try wrappingunicode
objects in anio.BytesIO
instance. (The bug wasn't uncovered until commit 4a10308 caused all strings in the test case to default tounicode
) This patch tests forstr
and andunicode
objects, and handles each appropriately.