After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 113578 - Python bindings for reader interface are blocking
Python bindings for reader interface are blocking
Status: VERIFIED DUPLICATE of bug 113580
Product: libxml2
Classification: Platform
Component: general
2.5.2
Other other
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2003-05-23 07:28 UTC by Jacek Konieczny
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jacek Konieczny 2003-05-23 07:28:00 UTC
(Bug report for version 2.5.7, which was not available on bugzilla)
Python bindings for inputBuffer/Reader interface use high-level file access
(like fread() in C) when low-level access (like reade()) could (and should)
be used. Reader waits for some (hardcoded?) number of characters instead of
processing what is available. This makes reader.Read() block even if there
are full tags available, which could be returned.

This is easy to workaround with the following code, but IMHO it should be
fixed in the bindings.

workaround example:

class MyFile:                                                             
            
    def __init__(self,file):                                              
                   
        self.fd=file.fileno()
        self.file=file
    def read(self,len):
        return os.read(self.fd,len)

input=libxml2.inputBuffer(MyFile(sys.stdin))
reader=input.newTextReader("ble")
Comment 1 Daniel Veillard 2003-06-09 10:15:45 UTC
As explained in #113580 expecting no buffering at any of the
layers just won't work in general.

Daniel

*** This bug has been marked as a duplicate of 113580 ***