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)

comment:1 Changed on 04/09/2015 at 03:46:03 PM by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed on 04/09/2015 at 06:28:51 PM by sebastian

  • Description modified (diff)
  • Resolution set to rejected
  • Review URL(s) modified (diff)
  • Status changed from reviewing to closed

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.

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from sebastian.
 
Note: See TracTickets for help on using tickets.