Message52960
This patch fixes the unit tests of both test_urllib2 and test_cookielib. The reason for combining them is that they both needed the changes to urllib.quote().
The largest part of this patch is to urllib.quote(), which would operate on unicode strings, but only so long as they didn't stray out of the ASCII range. The old code would create a dictionary with 256 entries that mapped incoming chars to their 'safe' replacements, and that dict was created once in its entirety when the function was first called and cached for later calls. Since the incoming character string is now unicode that method won't work.
The new code does not build the dict in its entirety, instead it memoizes the ASCII range translations as it runs. It does not memoize translations outside of the ASCII range as that would be hole by which you could exhaust a programs memory.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:59:27 | admin | link | issue1762940 messages |
2007-08-23 15:59:27 | admin | create | |
|