[Python-3000] bug in i/o module buffering? (original) (raw)
Guido van Rossum guido at python.org
Mon Oct 29 19:07:21 CET 2007
- Previous message: [Python-3000] Odd output from test -- buffering bug?
- Next message: [Python-3000] bug in i/o module buffering?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
index() converts an "int-like" object to an int. This is needed to make sure that e.g. numpy integral scalars can be used for indexing. For a regular int it doesn't matter, so here it's a red herring.
I'm asking about b because the error message "TypeError: 'slice' object does not support item deletion" would suggest that b is a slice object. I agree that doesn't sound very likely given the code though... :-( Could you step through this using pdb and investigate some more? Perhaps there's a refcount error somewhere in the C code?
--Guido
2007/10/27, Bill Janssen <janssen at parc.com>:
From RawIOBase.read(). What's index() do?
b = bytes(n.index()) > More interesting is, what's b? > > 2007/10/27, Bill Janssen <janssen at parc.com>: > > In the following, 'n' is equal to 0 (read from a non-blocking socket). > > Is this a bug in the I/O module buffering? > > > > Bill > > > > Traceback (most recent call last): > > File "/local/python/3k/src/Lib/SocketServer.py", line 222, in handlerequest > > self.processrequest(request, clientaddress) > > File "/local/python/3k/src/Lib/SocketServer.py", line 241, in processrequest > > self.finishrequest(request, clientaddress) > > File "/local/python/3k/src/Lib/SocketServer.py", line 254, in finishrequest > > self.RequestHandlerClass(request, clientaddress, self) > > File "/local/python/3k/src/Lib/SocketServer.py", line 522, in init > > self.handle() > > File "/local/python/3k/src/Lib/BaseHTTPServer.py", line 330, in handle > > self.handleonerequest() > > File "/local/python/3k/src/Lib/BaseHTTPServer.py", line 313, in handleonerequest > > self.rawrequestline = self.rfile.readline() > > File "/local/python/3k/src/Lib/io.py", line 391, in readline > > b = self.read(nreadahead()) > > File "/local/python/3k/src/Lib/io.py", line 377, in nreadahead > > readahead = self.peek(1, unsafe=True) > > File "/local/python/3k/src/Lib/io.py", line 778, in peek > > current = self.raw.read(toread) > > File "/local/python/3k/src/Lib/io.py", line 455, in read > > del b[n:] > > TypeError: 'slice' object does not support item deletion > > ---------------------------------------- > > _> > ________________________ > > Python-3000 mailing list > > Python-3000 at python.org > > http://mail.python.org/mailman/listinfo/python-3000 > > Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org > > > > > -- > --Guido van Rossum (home page: http://www.python.org/~guido/)
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-3000] Odd output from test -- buffering bug?
- Next message: [Python-3000] bug in i/o module buffering?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]