This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: upack fails under certain conditions on Windows
Type: Stage:
Components: Windows Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: theller Nosy List: kneppy, theller, tim.peters
Priority: normal Keywords:

Created on 2004-02-04 19:44 by kneppy, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
unpack_error.zip kneppy, 2004-02-04 19:44 Script and datafile displaying error
Messages (3)
msg19911 - (view) Author: Kevin (kneppy) Date: 2004-02-04 19:44
When using unpack to decode and swap byte orders for 
a binary file that consists of a series of unsigned 
integers (big-endian 32bit format)  on a Windows 2000 
& XP machine,  a false result is returned for certain 
values.  The script failed reading the first value with the 
number 26 in big-endian format ('\x00\x00\x00\x1a') 
The same script and datafile worked fine using cygwin's 
version of python on the same machines, and also 
worked correctly on a Linux machine.  The attached files 
should be able to reproduce the behavior.
msg19912 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2004-02-04 19:56
Logged In: YES 
user_id=11105

This is not a bug.  To read binary files on Windows, you
must open them with mode 'rb'.
msg19913 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-02-04 20:04
Logged In: YES 
user_id=31435

Change to Not-a-Bug.  Note that you *should* always open 
binary files in binary mode, regardless of platform.  On 
Windows you must do so (or suffer the consequences), but it 
doesn't hurt to do so on other platforms.
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39901
2004-02-04 19:44:16kneppycreate