On Fri, Apr 25, 2008 at 11:11 AM, Gabriel Rossetti <[EMAIL PROTECTED]> wrote: > yes, if you do it that way (s = '\x02') it works, but I read the data from > a file, and I that way it doesn't work....
It does work (using Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32) import Queue f = open('temp', 'w') f.write('\x02') f.close() f = open('temp', 'r') ch = f.read(1) f.close() print repr(ch) q = Queue.Queue(0) q.put(ch, True) print len(q.queue) prints the following: '\x02' 1 Perhaps you could put together an example that actually shows the behavior you're seeing. I'm not super familiar with Queue.Queue internals, but should you be accessing the undocumented q.queue (the internal deque of the Queue instance) directly? Shouldn't you be using the documented q.qsize() interface instead? -- Jerry -- http://mail.python.org/mailman/listinfo/python-list