[Python-bugs-list] [ python-Bugs-546117 ] readlines() bombs - last line incomplete
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 22 Apr 2002 10:45:38 -0700
Bugs item #546117, was opened at 2002-04-19 09:23
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=546117&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2.1 candidate
Status: Open
Resolution: None
Priority: 5
Submitted By: Peter Harris (scav)
Assigned to: Nobody/Anonymous (nobody)
Summary: readlines() bombs - last line incomplete
Initial Comment:
HP-UX 11 64bit, compiled with HP ansi c compiler.
Python version 2.2.1rc2
>>> f=open(some_big_file)
>>> f.readlines()
Pid 23292 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.
Memory fault(coredump)
Happens when last line of file lacks a terminating \n,
also the file has to be big enough (my example is about
2K in size)
Oddly, xreadlines() can be created, but attempting to
iterate over it crashes before the first line is
returned:
>>> f=open(some_big_file)
>>> lines=f.xreadlines() # OK so far
>>> for line in lines:
... print line # never gets here
...
Pid 23257 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.
Memory fault(coredump)
I'll try 2.2.1 final.
----------------------------------------------------------------------
>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-04-22 13:45
Message:
Logged In: YES
user_id=6380
I can't reproduce this on Linux. Can you upload the data
file or (preferably, if you have access) on a Linux system,
with Python 2.2.1? I'd like to see if this is data dependent
or platform specific before we go any further with this.
----------------------------------------------------------------------
Comment By: Peter Harris (scav)
Date: 2002-04-22 07:12
Message:
Logged In: YES
user_id=8911
2.2.1 final does it too. :(
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=546117&group_id=5470