Opened on 04/09/2015 at 03:45:02 PM
Closed on 04/09/2015 at 06:28:51 PM
#2296 closed change (rejected)
Get rid of codecs.open()
Reported by: | sebastian | Assignee: | sebastian |
---|---|---|---|
Priority: | P4 | Milestone: | |
Module: | Sitescripts | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown | |
Ready: | yes | Confidential: | no |
Tester: | Verified working: | no | |
Review URL(s): |
Description (last modified by sebastian)
Background
codecs.open() has been superseded by io.open(). Beside beeing newer, io.open() if used in text mode, also enforces the written data to be unicode objects, preventing accidental encoding issues.
Moreover, some code currently uses codecs.open() while binary data actually sent or expected. That code will currently result in encoding errors when encountering non-ASCII characters.
What to change
Replace codecs.open() with io.open() when processing decoded text, and otherwise with open().
Attachments (0)
Change History (2)
Note: See
TracTickets for help on using
tickets.
My assumptions here weren't quite right. Though using io.open() instead makes sense for new code, but this isn't worth changing the existing code. The prospect of breaking something and the afford properly testing the change would be too large.