1. 19 Dec, 2000 7 commits
    • Guido van Rossum's avatar
      Improve error messages for invalid warning arguments; don't raise · d1db30b7
      Guido van Rossum authored
      exceptions but always print a warning message.
      d1db30b7
    • Guido van Rossum's avatar
      Make string.translate(s, table) work for Unicode s. Two things are · 5aff7752
      Guido van Rossum authored
      required to work around restrictions on the arguments of
      u.translate():
      
      1) don't pass the deletions argument if it's empty;
      
      2) convert table to Unicode if s is Unicode.
      
      This fixes SF bug #124060.
      5aff7752
    • Guido van Rossum's avatar
    • Guido van Rossum's avatar
      Test more split argument combinations: · 8b264542
      Guido van Rossum authored
      1) multi-char separator
      2) multi-char separator that only occurs at last position
      3) all of the above with mixed Unicode and 8-bit-string arguments
      8b264542
    • Guido van Rossum's avatar
      Minimal fix for the complaints about pickling Unicode objects. (SF · fb10c3f6
      Guido van Rossum authored
      bugs #126161 and 123634).
      
      The solution doesn't use the unicode-escape encoding; that has other
      problems (it seems not 100% reversible).  Rather, it transforms the
      input Unicode object slightly before encoding it using
      raw-unicode-escape, so that the decoding will reconstruct the original
      string: backslash and newline characters are translated into their
      \uXXXX counterparts.
      
      This is backwards incompatible for strings containing backslashes, but
      for some of those strings, the pickling was already broken.
      
      Note that SF bug #123634 complains specifically that cPickle fails to
      unpickle the pickle for u'' (the empty Unicode string) correctly.
      This was an off-by-one error in load_unicode().
      
      XXX Ugliness: in order to do the modified raw-unicode-escape, I've
      cut-and-pasted a copy of PyUnicode_EncodeRawUnicodeEscape() into this
      file that also encodes '\\' and '\n'.  It might be nice to migrate
      this into the Unicode implementation and give this encoding a new name
      ('half-raw-unicode-escape'? 'pickle-unicode-escape'?); that would help
      pickle.py too.  But right now I can't be bothered with the necessary
      infrastructural changes.
      fb10c3f6
    • Guido van Rossum's avatar
      Test some Unicode pickling endcases. · 8b74b15b
      Guido van Rossum authored
      8b74b15b
    • Guido van Rossum's avatar
      Minimal fix for the complaints about pickling Unicode objects. (SF · a31b4ef7
      Guido van Rossum authored
      bugs #126161 and 123634).
      
      The solution doesn't use the unicode-escape encoding; that has other
      problems (it seems not 100% reversible).  Rather, it transforms the
      input Unicode object slightly before encoding it using
      raw-unicode-escape, so that the decoding will reconstruct the original
      string: backslash and newline characters are translated into their
      \uXXXX counterparts.
      
      This is backwards incompatible for strings containing backslashes, but
      for some of those strings, the pickling was already broken.
      a31b4ef7
  2. 18 Dec, 2000 3 commits
  3. 17 Dec, 2000 1 commit
  4. 16 Dec, 2000 3 commits
  5. 15 Dec, 2000 25 commits
  6. 14 Dec, 2000 1 commit