cpython/Modules
Guido van Rossum fb10c3f664 Minimal fix for the complaints about pickling Unicode objects. (SF
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.
2000-12-19 02:08:38 +00:00
..
.cvsignore
Makefile.pre.in Update dependencies per /F. 2000-11-28 12:09:18 +00:00
Setup.config.in Update a comment to be correct. 2000-10-26 14:57:29 +00:00
Setup.dist Add URL with info for PIL. 2000-12-12 21:07:08 +00:00
_codecsmodule.c Added a true unicode_internal_encode function and fixed the 2000-09-21 21:09:45 +00:00
_cursesmodule.c Wrapper for napms() function, contributed by Thomas Gellekum <tg@FreeBSD.org> 2000-12-15 00:44:02 +00:00
_localemodule.c Rationalize use of limits.h, moving the inclusion to Python.h. 2000-09-26 05:46:01 +00:00
_sre.c -- properly reset groups in findall (bug #117612) 2000-10-28 19:30:41 +00:00
_tkinter.c Do not release unallocated Tcl objects. Closes #117278 and #117167. 2000-10-29 00:44:43 +00:00
almodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
arraymodule.c Fix for SF bug 117402, crashes on str(array) and repr(array). This was an 2000-11-10 19:04:19 +00:00
audioop.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
binascii.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
bsddbmodule.c [Patch #102827] Fix for PR#119558, avoiding core dumps by checking for 2000-12-15 00:59:32 +00:00
cPickle.c Minimal fix for the complaints about pickling Unicode objects. (SF 2000-12-19 02:08:38 +00:00
cStringIO.c Added a new "base" type, IOobject for which most of the 2000-10-06 19:24:23 +00:00
ccpython.cc
cdmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
cgen.py
cgensupport.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
cgensupport.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
clmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
cmathmodule.c Use METH_VARARGS instead of numeric constant 1 in method def. tables 2000-08-03 02:06:16 +00:00
config.c.in Clarify two comments 2000-11-30 01:57:18 +00:00
cryptmodule.c Use METH_OLDARGS instead of numeric constant 0 in method def. tables 2000-08-03 02:34:44 +00:00
cstubs REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
dbmmodule.c Ka-Ping Yee <ping@lfw.org>: 2000-10-24 19:57:45 +00:00
dlmodule.c Remove one more gcc -Wall warning. 2000-10-11 21:44:02 +00:00
errnomodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
fcntlmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
flmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
fmmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
fpectlmodule.c Use PyOS_setsig() instead of signal(). Also remove redundant spaces 2000-09-21 14:32:04 +00:00
fpetestmodule.c
gcmodule.c - update Neil's email address 2000-10-04 16:34:09 +00:00
gdbmmodule.c Add support for gdbm2 open flags ('s' and 'u'). Add module constant 2000-12-17 07:14:13 +00:00
getbuildinfo.c Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)', 2000-07-21 06:00:07 +00:00
getpath.c Minor ANSIfication: lib_python no longer needs to be initialized 2000-09-28 14:32:29 +00:00
glmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
grpmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
imageop.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
imgfile.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
ld_so_aix
license.terms
linuxaudiodev.c Be consistent in the description of audio formats: <format> <width> 2000-10-08 19:47:47 +00:00
main.c Add the -W option. 2000-12-15 22:00:54 +00:00
makesetup The C+ compiler is called $(CXX) these days, not CCC. 2000-12-06 23:46:29 +00:00
makexp_aix
mathmodule.c Repaired a comment and asserted a precondition. 2000-10-12 19:42:00 +00:00
md5.h Rationalize use of limits.h, moving the inclusion to Python.h. 2000-09-26 05:46:01 +00:00
md5c.c Fix includes; not including Python.h caused the module not to compile on 2000-09-28 02:54:51 +00:00
md5module.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
mmapmodule.c my_getpagesize(): New function; returns the size of a page of memory. 2000-10-01 17:50:46 +00:00
mpzmodule.c Another gcc -Wall warning squashed: 2000-10-11 21:53:34 +00:00
newmodule.c Allow new.function() called with explicit 3rd arg of None, as 2000-11-13 20:29:20 +00:00
nismodule.c Even more ANSIfication: fix as many function pointers and declarations as 2000-07-22 23:57:55 +00:00
operator.c Add invert() and __invert__() as aliases for inv()/__inv__(). 2000-09-17 16:09:27 +00:00
parsermodule.c validate_varargslist(): Fix two bugs in this function, one that affected 2000-12-11 22:08:27 +00:00
pcre-int.h
pcre.h
pcremodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
posixmodule.c Trivial typo fix, submitted by Charles Waldman (SF patch #102794). 2000-12-12 00:37:58 +00:00
puremodule.c Do the absolute minimal amount of modifications to eradicate 2000-09-01 09:01:32 +00:00
pwdmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
pyexpat.c Add returns_unicode to the __members__ list. 2000-12-16 01:48:29 +00:00
pypcre.c Fix for bug #110651 (Jitterbug PR#343): only use the low 8 bits of an octal 2000-08-02 13:41:18 +00:00
python.c Even more ANSIfication: fix as many function pointers and declarations as 2000-07-22 23:57:55 +00:00
readline.c Supporting rl_library_version is more trouble than it's worth -- 2000-10-02 15:53:08 +00:00
regexmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
regexpr.c Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)', 2000-07-21 06:00:07 +00:00
regexpr.h
resource.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
rgbimgmodule.c Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)', 2000-07-21 06:00:07 +00:00
rotormodule.c merge Include/my*.h into Include/pyport.h 2000-07-31 15:28:04 +00:00
selectmodule.c SF bug 110843: Low FD_SETSIZE limit on Win32 (PR#41). Boosted to 512. 2000-12-12 01:18:41 +00:00
sgimodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
shamodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
signalmodule.c Make better use of GNU Pth -- patch by Andy Dustman. 2000-09-19 00:46:46 +00:00
socketmodule.c Adapted from a patch by Barry Scott, SF patch #102875 and SF bug 2000-12-18 22:23:44 +00:00
soundex.c Use METH_VARARGS instead of numeric constant 1 in method def. tables 2000-08-03 02:06:16 +00:00
sre.h -- added recursion limit (currently ~10,000 levels) 2000-08-03 16:29:50 +00:00
sre_constants.h final 0.9.8 updates: 2000-08-01 22:47:49 +00:00
stropmodule.c Rationalize use of limits.h, moving the inclusion to Python.h. 2000-09-26 05:46:01 +00:00
structmodule.c Rationalize use of limits.h, moving the inclusion to Python.h. 2000-09-26 05:46:01 +00:00
sunaudiodev.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
svmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
syslogmodule.c Do the absolute minimal amount of modifications to eradicate 2000-09-01 09:01:32 +00:00
tclNotify.c Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)', 2000-07-21 06:00:07 +00:00
termios.c Use METH_OLDARGS instead of numeric constant 0 in method def. tables 2000-08-03 02:34:44 +00:00
threadmodule.c t_bootstram(): Use PySys_WriteStderr() instead of fprintf(stderr,...). 2000-10-20 20:02:37 +00:00
timemodule.c The Mac C library (MSL from CodeWarrior 6) and I/O library (GUSI 2000-12-12 22:42:30 +00:00
timing.h
timingmodule.c Do the absolute minimal amount of modifications to eradicate 2000-09-01 09:01:32 +00:00
tkappinit.c Removing warnings discovered by gcc -Wall 2000-08-04 15:53:06 +00:00
ucnhash.c Fix UCNs machine with >= 32bit longs 2000-07-26 03:56:06 +00:00
unicodedata.c unicode database compression, step 2: 2000-09-25 08:07:06 +00:00
unicodedata_db.h Added 38,642 missing characters to the Unicode database (first-last 2000-11-03 20:24:15 +00:00
unicodedatabase.c Fix header file usage so that NULL is defined. NULL is needed by 2000-09-30 17:34:31 +00:00
unicodedatabase.h unicode database compression, step 2: 2000-09-25 08:07:06 +00:00
xxmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
yuv.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
yuvconvert.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
zlibmodule.c Patch #101810: check whether zst.avail_out is non-zero when getting 2000-10-09 14:18:10 +00:00