cpython/Lib
Barry Warsaw 1d0fe31d7e Packer.pack_uhyper(): Fixes needed to properly pack unsigned 64 bit
longs where the top bit is set.  First, change the masks so that they
are `L' longs, otherwise the sign bits will get propagated to the
result.  Next, do not coerce to int before sending to pack_uint()
otherwise Python will generate an OverflowError.  Here is a test
program that fails without the patch, but now succeeds:

import xdrlib

addr = (132, 151, 1, 71)
uint = 0L
for a in addr:
    uint = (uint << 8) | a

ulong64 = uint << 32

p = xdrlib.Packer()
p.pack_uhyper(ulong64)
buf = p.get_buffer()
u = xdrlib.Unpacker(buf)
ulong64prime = u.unpack_uhyper()

if ulong64 == ulong64prime:
    print 'okay'
else:
    print 'bogus'

print ulong64, ulong64prime
1997-05-29 21:01:35 +00:00
..
aix3 New AIX specific subdirs 1996-08-08 18:24:58 +00:00
aix4 New AIX specific subdirs 1996-08-08 18:24:58 +00:00
dos-8x3 The usual 1997-05-22 20:48:03 +00:00
dos_8x3 The usual 1997-05-22 20:48:03 +00:00
freebsd2 FreeBSD platform specific modules 1996-07-30 21:05:10 +00:00
generic Use fcntl.h instead of sys/fcntl.h; use h2py.py from Tools/scripts 1996-08-08 18:25:40 +00:00
irix5 Added QUADRO. 1996-12-13 00:19:15 +00:00
irix6 Irix 6 specific files -- thanks Sjoerd! 1997-01-15 19:19:19 +00:00
lib-old Changes to always call list.append with a single argument. 1996-10-08 14:06:35 +00:00
lib-stdwin Fixed conversion between seconds and milliseconds. 1996-12-12 23:42:20 +00:00
lib-tk Widget._setup(): Support name=None in a similar way to the handling of other 1997-05-27 22:45:10 +00:00
linux1 more recent linux header files 1996-01-26 17:43:46 +00:00
linux2 Regenerated on a newer Linux version. 1997-05-09 02:21:06 +00:00
next3 regen for Next 1996-08-16 18:14:41 +00:00
plat-aix3 New AIX specific subdirs 1996-08-08 18:24:58 +00:00
plat-aix4 New AIX specific subdirs 1996-08-08 18:24:58 +00:00
plat-freebsd2 FreeBSD platform specific modules 1996-07-30 21:05:10 +00:00
plat-generic Use fcntl.h instead of sys/fcntl.h; use h2py.py from Tools/scripts 1996-08-08 18:25:40 +00:00
plat-irix5 Added QUADRO. 1996-12-13 00:19:15 +00:00
plat-irix6 Irix 6 specific files -- thanks Sjoerd! 1997-01-15 19:19:19 +00:00
plat-linux1 more recent linux header files 1996-01-26 17:43:46 +00:00
plat-linux2 Regenerated on a newer Linux version. 1997-05-09 02:21:06 +00:00
plat-next3 regen for Next 1996-08-16 18:14:41 +00:00
plat-sunos4 Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
plat-sunos5 Regenerated on newer Solaris version 1997-05-13 17:45:56 +00:00
plat-win Get rid of debug print statements 1996-08-20 20:00:51 +00:00
stdwin Fixed conversion between seconds and milliseconds. 1996-12-12 23:42:20 +00:00
sunos4 Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
sunos5 Regenerated on newer Solaris version 1997-05-13 17:45:56 +00:00
test Add test for presence of socket_type. 1997-05-21 14:38:57 +00:00
tkinter Widget._setup(): Support name=None in a similar way to the handling of other 1997-05-27 22:45:10 +00:00
win Get rid of debug print statements 1996-08-20 20:00:51 +00:00
AST.py New batch from Fred 1996-08-21 14:32:37 +00:00
BaseHTTPServer.py fix several bogus var refs in error reporting 1996-02-12 23:58:38 +00:00
Bastion.py Removed RCS crud from official Python release version. 1996-10-08 14:14:49 +00:00
CGIHTTPServer.py Remove some bogus code that would cause a NameError if a -r option was passed. 1997-02-19 20:07:38 +00:00
Makefile Added Makefile with clean and clobber targets 1994-01-04 23:24:22 +00:00
MimeWriter.py Removed RCS crud from official Python release version. 1996-10-08 14:14:49 +00:00
Para.py Changes to always call list.append with a single argument. 1996-10-08 14:06:35 +00:00
Queue.py Some minute changes. 1993-12-29 15:33:08 +00:00
SimpleHTTPServer.py Get rid of nobody_uid() and import pwd -- not used here. 1996-09-04 23:42:04 +00:00
SocketServer.py Make self.rfile unbuffered (self.wfile already is). This should fix 1996-10-23 14:30:23 +00:00
StringIO.py Sjoerd's StringIO speed-up 1996-06-19 14:54:19 +00:00
UserDict.py * test_*.py: new lambda syntax (also affects tests for filter, map, 1993-11-30 13:43:54 +00:00
UserList.py added * and + operators 1996-05-28 22:56:16 +00:00
addpack.py urlopen: add basejoin() function. 1994-03-07 11:45:36 +00:00
aifc.py Use newer struct, which handles unsigned long right 1997-01-11 19:21:09 +00:00
anydbm.py inherit error from _mod.error 1996-01-25 18:26:57 +00:00
audiodev.py Added support for 4-channel on SGI. 1996-12-13 00:19:56 +00:00
base64.py Set correct RFC number. Open input in binary. 1997-05-08 23:10:42 +00:00
bdb.py Allow code objects to be passed to run() and eval(). 1996-10-15 14:40:21 +00:00
binhex.py Merged in Jack's fixes. This brings some lines beyond 79 chars again; 1997-02-11 16:39:31 +00:00
bisect.py
builtin.py added builtin b/w compat module. 1993-10-22 14:24:22 +00:00
calendar.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
cgi.py Tweak default source of query a bit so it is possible to invoke 1997-05-28 15:39:15 +00:00
cmd.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
cmp.py fix buffer size 1994-10-09 22:34:40 +00:00
cmpcache.py fix buffer size 1994-10-09 22:34:40 +00:00
codehack.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
colorsys.py
commands.py Added clarifying comment 1995-01-04 19:20:00 +00:00
compileall.py Don't trip over empty string in sys.path. 1996-07-31 21:18:42 +00:00
copy.py Remove '(' in column 0 of doc strings. 1997-05-28 19:31:14 +00:00
copy_reg.py Added some minimal comments and tweaked lay-out a bit. 1997-05-20 18:03:22 +00:00
dbhash.py backward compatible interface for bsddb 1996-01-25 18:33:39 +00:00
dircache.py
dircmp.py * Got entirely rid of path.py. 1992-12-14 12:57:56 +00:00
dis.py Modernized for 1.5 1997-05-09 03:21:44 +00:00
dospath.py redefined normcase() 1995-08-10 19:27:42 +00:00
dumbdbm.py export error == IOError 1996-05-28 22:58:40 +00:00
dump.py
emacs.py
find.py changes for the Mac 1995-01-27 02:41:45 +00:00
fmt.py Change to always call list.append with a single argument. 1996-10-08 14:06:17 +00:00
fnmatch.py changes for the Mac 1995-01-27 02:41:45 +00:00
formatter.py (formatter.py): Add a flush() method to the writer interface. This really 1996-12-31 20:50:51 +00:00
fpformat.py
ftplib.py Added Fred Drake's netrc parser class. 1997-03-14 04:16:54 +00:00
getopt.py Layout and cleanup by Fred 1996-09-11 19:43:52 +00:00
glob.py New doc strings. 1997-04-02 05:47:11 +00:00
gopherlib.py Changed makefile() args from r/w to rb/wb, for non-unix compatability. 1996-02-14 16:06:24 +00:00
grep.py
gzip.py Adding Jeremy Hylton's gzip module. 1997-04-30 16:04:57 +00:00
htmlentitydefs.py added &quot def 1996-05-28 23:18:55 +00:00
htmllib.py improved test() 1996-02-13 00:02:10 +00:00
httplib.py In the HTTP reply header, be more accepting in the HTTP version. 1996-12-10 15:58:22 +00:00
ihooks.py Set the __file__ attribute of the imported module in both versions of 1996-10-07 23:41:54 +00:00
imghdr.py (Jack:) Recognize PNG files. 1997-04-11 18:59:38 +00:00
keyword.py Ping's new version -- more efficient at finding the keywords. 1997-03-20 20:40:45 +00:00
linecache.py don't print Cannot open/stat messages 1995-08-10 19:32:22 +00:00
lockfile.py Module to lock open files using fcntl() 1994-05-03 14:46:18 +00:00
macpath.py Fix for boundary case (Jack) 1997-05-21 14:59:17 +00:00
macstat.py * Lib/linecache.py: don't crash on empty filename 1994-08-23 13:32:20 +00:00
macurl2path.py Handling of pathnames pointing to files on toplevel folder of disk was 1997-05-20 16:00:07 +00:00
mailbox.py Added BabylMailbox class by Fred Lundh (untested). 1997-05-15 14:33:09 +00:00
mailcap.py Change by Andrew Kuchling (edited by Guido): 1997-03-25 21:58:08 +00:00
mhlib.py Reindented with 4 spaces. 1997-04-16 02:47:12 +00:00
mimetools.py Added getparamnames() to Message class -- return a list of all 1996-10-04 20:14:02 +00:00
mimify.py base64 support by Sjoerd. 1997-04-11 15:22:56 +00:00
multifile.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
mutex.py Change to always call list.append with a single argument. 1996-10-08 14:06:17 +00:00
newdir.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
newimp.py Official version 1.26 directly from Ken 1995-07-12 15:34:34 +00:00
ni.py Fix type in loop stripping '__.' from name 1996-09-10 17:38:20 +00:00
ni1.py Fix type in loop stripping '__.' from name 1996-09-10 17:38:20 +00:00
nntplib.py Change the list() function to match the documentation in the comment 1997-03-14 04:18:20 +00:00
ntpath.py join(): Wax the incorrect leading comment 1997-02-18 22:06:21 +00:00
nturl2path.py url2path for NT 1996-06-26 19:47:56 +00:00
os.py Added hook to os.environ to call putenv(), if it exists. 1996-07-24 00:55:17 +00:00
ospath.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
packmail.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
pdb.doc Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
pdb.py /usr/local/bin/python -> /usr/bin/env python 1996-11-27 19:52:01 +00:00
persist.py * ftplib.py: added abort() command (sends oob data). 1993-05-24 14:16:22 +00:00
pickle.py Restore two features of the original 1.4 pickle: 1997-04-25 19:52:29 +00:00
pipes.py * Mass change: get rid of all init() methods, in favor of __init__() 1993-12-17 15:25:27 +00:00
poly.py fix bug in poly.minus 1994-10-20 22:02:03 +00:00
popen2.py Change inspired by Tommy Burnette to add an interface to get stderr, too. 1997-04-21 14:15:55 +00:00
posixfile.py Added linux2 specific code :-( 1996-09-10 17:40:16 +00:00
posixpath.py join(): join one or more path components 1997-02-18 21:53:25 +00:00
pprint.py Fix a couple of glitches identified by Greg Stein. 1997-04-18 13:54:13 +00:00
profile.doc Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
profile.py /usr/local/bin/python -> /usr/bin/env python 1996-11-27 19:52:01 +00:00
pstats.py more robust coding, adapted for mac 1995-09-30 16:48:54 +00:00
pty.py New tty/pty modules by Steen; new urlparser. 1994-09-12 10:36:35 +00:00
py_compile.py compile(): Use the __debug__ flag to determine the proper filename extension 1997-03-13 14:13:16 +00:00
pyclbr.py Don't add names that start with _ 1996-10-10 16:00:28 +00:00
quopri.py Set correct RFC number. 1997-05-08 23:11:04 +00:00
rand.py
random.py Changes to use default argument values where possible 1994-05-06 14:28:19 +00:00
regex_syntax.py
regexp.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
regsub.py Store the current regex syntax along with the regular expression 1997-02-18 18:52:55 +00:00
repr.py use getattr() instead of eval(), fix string representations 1995-01-12 12:29:17 +00:00
rexec.py Alas, I have to restore 'marshal', since it is needed by the new 1997-04-25 19:10:15 +00:00
rfc822.py Added support for RFC 850 style dates, as used by some HTTP servers 1996-12-27 15:42:35 +00:00
robotparser.py Skip Montanaro's robots.txt parser. 1997-01-30 03:18:23 +00:00
sched.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
sgmllib.py (sgmllib.py): Partial acceptance of patch from David Leonard 1996-12-16 21:56:27 +00:00
shelve.py Added a 'sync' method to shelve. If the underlying database does not have a sync 1997-03-25 16:06:03 +00:00
shutil.py Transformed comments to doc strings. 1997-04-29 14:45:19 +00:00
site.py site customization hook... 1996-08-17 19:56:26 +00:00
sndhdr.py sndhdr.py: restored lost file; audiodev.py: import platform specific 1994-01-14 16:46:14 +00:00
stat.py * Lib/linecache.py: don't crash on empty filename 1994-08-23 13:32:20 +00:00
statcache.py Use global statement instead of importing ourselves to get to global 1995-12-07 10:16:45 +00:00
string.py Changed my mind on replace(). 1997-04-02 05:49:46 +00:00
stringold.py Changed my mind on replace(). 1997-04-02 05:49:46 +00:00
sunau.py Get rid of access statement 1996-08-20 20:40:07 +00:00
sunaudio.py
symbol.py New symbols due to assert statement. 1997-04-02 05:46:05 +00:00
tb.py noted obsolescence; exec() -> exec 1995-08-10 19:43:04 +00:00
tempfile.py (Jack:) Better MacOS support. 1997-04-11 19:00:53 +00:00
toaiff.py * Mass change: get rid of all init() methods, in favor of __init__() 1993-12-17 15:25:27 +00:00
token.py New batch from Fred 1996-08-21 14:32:37 +00:00
tokenize.py Ping's latest. Fixes triple quoted strings ending in odd 1997-04-09 17:15:54 +00:00
traceback.py Changes to always call list.append with a single argument. 1996-10-08 14:06:35 +00:00
tty.py New tty/pty modules by Steen; new urlparser. 1994-09-12 10:36:35 +00:00
types.py Ellipses -> Ellipsis rename (the dictionary really says that it should 1996-10-11 16:25:41 +00:00
tzparse.py Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
urllib.py lowercase proxies env variables, for Windows. 1997-05-28 15:37:19 +00:00
urlopen.py urlopen: add basejoin() function. 1994-03-07 11:45:36 +00:00
urlparse.py Added characteristics of shttp, https, and snews. 1997-01-02 18:18:27 +00:00
util.py
uu.py while (1) -> while 1. Sorry. 1997-04-08 19:46:53 +00:00
wave.py Get rid of access statement 1996-08-20 20:40:07 +00:00
whatsound.py * calendar.py: all libC functionality now moved to built-in time module 1993-06-23 09:30:50 +00:00
whichdb.py Use new struct which supports standardized sizes 1997-01-11 19:22:11 +00:00
whrandom.py Properly parenthesize a long Boolean combination. Formerly, you could 1997-01-02 18:13:35 +00:00
xdrlib.py Packer.pack_uhyper(): Fixes needed to properly pack unsigned 64 bit 1997-05-29 21:01:35 +00:00
zmod.py