473,386 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

bugs at iter file() ?

dw
Python 2.3.4, winxp:

I have a large text file that unknowingly contains ascii
character 1A, or chr(26). And doing this:

for line in file(sys.argv[1]):
print line

would stop iteration at the specific line containing ascii
char 1A, without raising exception or warning, although
there were still remaining lines which has not been
iterated. I was wondering whether this was a bug in
Python.

Thx.

--
dody wijaya

================================================== =========================================
"Gabung INSTANIA, dapatkan XENIA. Daftar di www.telkomnetinstan.com, langsung dapat akses Internet Gratis..
Dan ..ikuti "Instan Smile" berhadiah Xenia,Tour S'pore, Komputer,dll, info hub : TELKOM Jatim 0-800-1-467826 "
================================================== =========================================
Jul 18 '05 #1
0 1094

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dw | last post by:
>> Yep, simple, but works. Thanks, now I should know to use >> 'b' all the time! TP> Nope, only for binary files. If you open a text file in binary mode TP> on Windows, you get other problems...
21
by: Steven Bethard | last post by:
Jack Diederich wrote: > > itertools to iter transition, huh? I slipped that one in, I mentioned > it to Raymond at PyCon and he didn't flinch. It would be nice not to > have to sprinkle 'import...
4
by: Tuure Laurinolli | last post by:
Someone pasted the original version of the following code snippet on #python today. I started investigating why the new-style class didn't work as expected, and found that at least some instances...
6
by: hopangtsun | last post by:
Hello all, I've got a problem on operator overloading, I don't know what's wrong with my code. Can anyone kindly tell me what's the problem is? Thanks //this is the error message I've got...
3
by: Will McGugan | last post by:
Hi, I've been using Python for years, but I recently encountered something in the docs I wasnt familar with. That is, using two arguements for iter(). Could someone elaborate on the docs and...
13
by: thomas | last post by:
suppose I will delete an element pointed to by "iter". like this: vector<ints; for(vector<int>::iterator iter=s.begin(); iter!=s.end(); iter++){ if(*iter==3) s.erase(iter); ...
3
by: gert | last post by:
what is the difference between iter(lambda:f.read(8192), ') and iter(f.read(8192),'') ?
3
by: Lie | last post by:
When you've got a nested loop a StopIteration in the Inner Loop would break the loop for the outer loop too: a, b, c = , , def looper(a, b, c): for a_ in a: for b_ in b: for c_ in c:...
15
by: puzzlecracker | last post by:
I see that a lot of former in the code, and wonder if there is a technical reason for that
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.