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: read() in windows stops on chr(26)
Type: Stage:
Components: Windows Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, reson5, sf-robot
Priority: normal Keywords:

Created on 2006-11-13 19:17 by reson5, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg30540 - (view) Author: reson5 (reson5) Date: 2006-11-13 19:17
From standard distribution (installation through .exe 
file):

open() function in Windows (I have win2k and xp)
opens files in text mode and stops on chr(26).
I cannot parse a binary file (!).
On Linux all works fine.

Regards,
   Reson5
msg30541 - (view) Author: reson5 (reson5) Date: 2006-11-13 19:20
Logged In: YES 
user_id=1355850

To clarify,
The behavior is not uniform
on Linux it opens in binary and on windows in text (!)

Regards, 
    Reson5
msg30542 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-11-13 19:29
Logged In: YES 
user_id=849994

chr(26) or Ctrl+Z is the end-of-file character in Windows,
for text-mode files.

If you open the file in binary mode, e.g. with
open("filename", "rb"), there should be
no problems with reading the chr(26).
msg30543 - (view) Author: SourceForge Robot (sf-robot) Date: 2006-11-28 03:20
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44230
2006-11-13 19:17:26reson5create