Message111894
You can write "%20s" as a argument for PyUnicode_FromFormat(), but it has no effect. The width and precision modifiers are not intended to apply to string formating(%s, %S, %R, %A), only apply to integer(%d, %u, %i, %x). Though you can write "%20s", but you cannot write "%20S", "%20R" and "%20A".
There can be several fixes:
1. make the presence of width and precision modifiers of %s, %S, %R, %A raise an Exception, like ValueError, instead of segment fault.
2. make the presence of width and precision modifiers of %s, %S, %R, %A have no effect, just like current %s.
3. make the presence of width and precision modifiers of %s, %S, %R, %A do have correct effect, like %r and %s in string formatting in python code.
Thanks to Eric's ideas. Now I'm sure I prefer the last fix. I will work out a patch for this. |
|
Date |
User |
Action |
Args |
2010-07-29 06:08:09 | ysj.ray | set | recipients:
+ ysj.ray, lemburg, mark.dickinson, eric.smith, ron_adam, ezio.melotti |
2010-07-29 06:08:09 | ysj.ray | set | messageid: <1280383689.41.0.797458494299.issue7330@psf.upfronthosting.co.za> |
2010-07-29 06:08:07 | ysj.ray | link | issue7330 messages |
2010-07-29 06:08:07 | ysj.ray | create | |
|