[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b26471a2a115 by Ezio Melotti in branch '2.7': #14519: fix the regex used in the scanf example. http://hg.python.org/cpython/rev/b26471a2a115 New changeset e317d651ccf8 by Ezio Melotti in branch '3.2': #14519: fix the regex used in the scanf example. http://hg.python.org/cpython/rev/e317d651ccf8 New changeset 7cc1cddb378d by Ezio Melotti in branch 'default': #14519: merge with 3.2. http://hg.python.org/cpython/rev/7cc1cddb378d -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed, thanks for the report and the suggestions! -- assignee: docs@python - ezio.melotti resolution: - fixed stage: needs patch - committed/rejected status: open - closed type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
py.user bugzilla-mail-...@yandex.ru added the comment: the same problem in the %o analog valid strings for the %x specifier of scanf(): +0xabc -0xabc +abc -abc valid strings for the %o specifier of scanf(): +0123 -0123 +123 -123 how to patch the %x specifier: 0[xX][\dA-Fa-f]+ - [-+]?(0[xX])?[\dA-Fa-f]+ the %o specifier: 0[0-7]*- [-+]?[0-7]+ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
Terry J. Reedy tjre...@udel.edu added the comment: I checked Standard C by Plauger Brodie and as I read it, it agrees with py.user and his C compiler. For stdlib strtol() and strtoul(), the 0x/0X prefixes are accepted but optional for explicit base 16. If base is given as 0, they are accepted and set the base to 16 (which is otherwise 10). Except for %i, Xscanf functions apparently call either of the above with an explicit base, which is 16 for the %x specifiers. -- keywords: +easy, patch nosy: +terry.reedy stage: - needs patch versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
New submission from py.user bugzilla-mail-...@yandex.ru: http://docs.python.org/py3k/library/re.html#simulating-scanf 0[xX][\dA-Fa-f]+ - (0[xX])?[\dA-Fa-f]+ -- assignee: docs@python components: Documentation, Regular Expressions messages: 157711 nosy: docs@python, ezio.melotti, mrabarnett, py.user priority: normal severity: normal status: open title: In re's examples the example with scanf() contains wrong analog for %x, %X specifiers versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
R. David Murray rdmur...@bitdance.com added the comment: The documentation appears to be correct to me. Can you demonstrate your suggestion with some examples? -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
py.user bugzilla-mail-...@yandex.ru added the comment: the prefix 0x is not necessary for the %x specifier in C if the pattern will see ABC, it will not match with it, but it should match -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14519] In re's examples the example with scanf() contains wrong analog for %x, %X specifiers
py.user bugzilla-mail-...@yandex.ru added the comment: #include stdio.h int main(void) { unsigned n; scanf(%x, n); printf(%u\n, n); return 0; } [guest@localhost c]$ .ansi t.c -o t [guest@localhost c]$ ./t 0xa 10 [guest@localhost c]$ ./t a 10 [guest@localhost c]$ [guest@localhost c]$ alias .ansi alias .ansi='gcc -ansi -pedantic -Wall' [guest@localhost c]$ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14519 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com