Changes between and of Version 1Version 2Ticket #8077, comment 3


Ignore:
Timestamp:
11/25/2015 12:59:15 PM (4 years ago)
Author:
Pawel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8077, comment 3

    v1 v2  
    11> cookie names and all its components should be handled bytes.
    22
    3 yes you are right. This is what happens now if you look at line 1010 of twisted.web.http it converts cookie strings to bytes by using NetworkString utility from compat. addCookie appends cookies to self.cookies and write() converts them to bytes.
     3yes you are right. This is what happens now if you look at line 1010 of twisted.web.http it converts cookie strings to bytes by using NetworkString utility from compat. addCookie appends cookies to self.cookies and write() converts them to bytes. At the moment addCookie() function does not need bytes, it accepts unicode or ascii strings all right, and seems like this is what it always done so I think we should keep this behavior.
    44
    55We could add some update to addCookie but only update that seems meaningful IMO is replacing old style modulo style formatting with plain string.format() - benefit of format() is that if user passes byte string as cookie part it will be correctly converted to unicode in python3 and to 8 bit string in Python2. You think we should do this?