Ticket #3930 (closed defect: fixed)

Opened 13 months ago

Last modified 10 months ago

t.i._pollingfile silently accepts unicode for writing

Reported by: dotz Owned by: therve
Priority: normal Milestone:
Component: core Keywords: win32
Cc: Branch: branches/pollingfile-unicode-3930
Author: therve Launchpad Bug:

Description

Hi,

this little bug took me about 3 hours to track. I use tx ampoule  https://launchpad.net/ampoule on win32 (Vista). Some AMP commands were passed correctly over ampoule; some were not and it looked like every single byte was separated by a NULL byte... As it came out, unicode string was passed to t.i._pollingfile write function and the AMP command sent by ampoule and Twisted amp was received mangled.

I propose we disallow writing unicode objects. If user wants to write unicode, he/she will have to convert it to utf-8 string before.

Attachments

disable-unicode-pollingfile.patch Download (0.6 KB) - added by dotz 13 months ago.
disable unicode for _pollingfile
fix-3930.patch Download (1.4 KB) - added by dotz 10 months ago.
Patch with no assert and an unit test

Change History

Changed 13 months ago by dotz

disable unicode for _pollingfile

Changed 13 months ago by dotz

  • type changed from enhancement to defect

Changed 12 months ago by dotz

Do you need anything else from me to get this one small change merged?

Changed 12 months ago by glyph

  • owner changed from glyph to dotz

Tests, and the removal of the usage of "assert" (IIRC it's against the coding standard).

Thanks!

Changed 10 months ago by dotz

Patch with no assert and an unit test

Changed 10 months ago by dotz

  • owner dotz deleted
  • keywords win32 review added

New patch added. I hope that this will allow you to fix this. Thanks for your time!

Changed 10 months ago by therve

  • branch set to branches/pollingfile-unicode-3930
  • branch_author set to therve

(In [27467]) Branching to 'pollingfile-unicode-3930'

Changed 10 months ago by therve

  • owner set to therve

Changed 10 months ago by therve

  • status changed from new to closed
  • resolution set to fixed

Merged in r27469, thanks for the patch!

Changed 10 months ago by therve

  • keywords review removed
Note: See TracTickets for help on using tickets.