Message172723
> 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? |
|
Date |
User |
Action |
Args |
2012-10-12 07:34:16 | maker | set | recipients:
+ maker, ezio.melotti, santoso.wijaya |
2012-10-12 07:34:16 | maker | set | messageid: <1350027256.04.0.313547778916.issue16201@psf.upfronthosting.co.za> |
2012-10-12 07:34:16 | maker | link | issue16201 messages |
2012-10-12 07:34:15 | maker | create | |
|