This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author maker
Recipients ezio.melotti, maker, santoso.wijaya
Date 2012-10-12.07:34:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1350027256.04.0.313547778916.issue16201@psf.upfronthosting.co.za>
In-reply-to
Content
> Attaching patch to trim leading and trailing whitespaces prior to
> processing.
Note that tests are incorrect: the parsing is of the form %d.%d.%d.%d%c, so the parser should accept trailing spaces. That's the same for ping iirc: 

$ ping "192.168.1.1    "
PING 192.168.1.1     (192.168.1.1) 56(84) bytes of data.

--- 192.168.1.1     ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms

$ ping " 192.168.1.1"
ping: unknown host  192.168.1.1


I am trying to get out with a simple parser inside the function, probabl y strtol() is the way. 
 Since Python's C API does not provide any sscanf wrapper, I thought about adding a new one. But given that, AFAIS it appears just two times over the entire sourcecode, there is no need IMO for exporting a new one right now. What is your opinion?
History
Date User Action Args
2012-10-12 07:34:16makersetrecipients: + maker, ezio.melotti, santoso.wijaya
2012-10-12 07:34:16makersetmessageid: <1350027256.04.0.313547778916.issue16201@psf.upfronthosting.co.za>
2012-10-12 07:34:16makerlinkissue16201 messages
2012-10-12 07:34:15makercreate