string formatter %x and a class instance with __int__ or __long__ cannot handle long

2007-06-20 Thread Kenji Noguchi
ong type value in the Example2. The "%08x" allows either int or long in the Example1, however it accepts int only in the Example2. Is this a bug or expected? by the way same thing happends on a 64bit system with a value of 0x8000. Regards, Kenji Noguchi -- http://mail.python.org/mailman/listinfo/python-list

Re: string formatter %x and a class instance with __int__ cannot handle long

2007-06-21 Thread Kenji Noguchi
pears to be ok. 2007/6/20, Gabriel Genellina <[EMAIL PROTECTED]>: > It is a bug, at least for me, and I have half of a patch addressing it. As > a workaround, convert explicitely to long before formatting. I'm interested in your patch. What's the other half still missing? Thanks

Re: string formatter %x and a class instance with __int__ cannot handle long

2007-06-21 Thread Kenji Noguchi
is a hack on a hack. I expect Python3000 won't have such problem as they unify int and long. Thanks Kenji Noguchi --- stringobject.c.org 2007-06-21 13:57:54.745877000 -0700 +++ stringobject.c 2007-06-21 13:59:19.576646000 -0700 @@ -4684,6 +4684,15 @@ ca

Re: Tailing a log file?

2007-06-22 Thread Kenji Noguchi
something like this? unix tail command does more fancy stuff like it waits for timeout, and check if the file is truncated or depending on incoming data it sleeps seconds , etc etc. #!/usr/bin/env python import sys, select while True: ins, outs, errs = select.select([sys.stdin],[],[]) for

Re: developing web spider

2008-04-04 Thread Kenji Noguchi
I've extended it for multi-thread, limit the number of thread for a specific web host, more flexible element handling, etc, etc. SQLite is nice for making URL db by the way. Kenji Noguchi #!/usr/bin/env python # -*- coding: utf-8 -*- import sys, urllib, urllib2, cookielib import xml.do