[issue21547] '!s' formatting documentation bug
New submission from Joshua Landau: In the docs for 2.x about the formatting syntax: https://docs.python.org/2/library/string.html#format-string-syntax it says Two conversion flags are currently supported: '!s' which calls str() on the value, and '!r' which calls repr(). but for unicode formatters, '!s' calls unicode() instead. See http://stackoverflow.com/questions/23773816/why-python-str-format-doesnt-call-str for the question that found this. -- assignee: docs@python components: Documentation messages: 218863 nosy: Joshua.Landau, docs@python priority: normal severity: normal status: open title: '!s' formatting documentation bug versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21547 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14776] Add SystemTap static markers
Bohuslav Slavek Kabrda added the comment: I'd be fine with adapting the patch to support both systemtap and dtrace, however I have very little knowledge of dtrace and I don't have a machine to test it on. @jcea would you be willing to work on such patch with me? I'm sure we could work on this together and reuse each others' code as much as possible. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14776 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21548] pydoc -k IndexError on empty docstring
New submission from Dima Tisnek: While trying to track down another bug, I disabled some packages: [dima@bmg tmp]$ chmod a-x /usr/lib/python3.4/site-packages/speechd* Then ran pydoc -k: [dima@bmg tmp]$ pydoc3.4 -k n688954789 Traceback (most recent call last): File /usr/bin/pydoc3.4, line 5, in module pydoc.cli() File /usr/lib/python3.4/pydoc.py, line 2548, in cli apropos(val) File /usr/lib/python3.4/pydoc.py, line 2080, in apropos ModuleScanner().run(callback, key, onerror=onerror) File /usr/lib/python3.4/pydoc.py, line 2061, in run desc = (module.__doc__ or '').splitlines()[0] IndexError: list index out of range Clearly .splitlines() is always empty; missing doc is not handled correctly. -- components: Library (Lib) messages: 218865 nosy: Dima.Tisnek priority: normal severity: normal status: open title: pydoc -k IndexError on empty docstring versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21541] Provide configure option --with-ssl for compilation with custom openssl
Changes by Michele Orrù maker...@gmail.com: -- nosy: +maker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21541 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21549] Add the members parameter for TarFile.list()
New submission from Serhiy Storchaka: The proposed patch adds the members parameter for TarFile.list() with the same meaning as in TarFile.extractall(). This is needed for implementing the tar command utility which allows filtering and transforming an output (e.g. output numerical ids instead names for owner/group). An alternative approach is to add the filter parameter (as in TarFile.add()) to both TarFile.list() and TarFile.extractall(). -- components: Library (Lib) files: tarfile_list_members.patch keywords: patch messages: 218866 nosy: lars.gustaebel, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add the members parameter for TarFile.list() type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file35307/tarfile_list_members.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21549 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21550] Add Python implementation of the tar utility
New submission from Serhiy Storchaka: Here is preliminary Python implementation of the tar archiving utility. I propose to add it to Tools/script. The main purpose of this the research of which features needed the tarfile module. Another purpose is that this provides more powerful tool to create or extract tar archives on platforms where the tar utility is not installed (the tarfile module itself provides very simple command line interface). Supported options are mainly common subset of GNU tar and bsdtar options. Some options (--absolute-names, controlling of symlinks and hardlings dereferencing and files overwriting) needs implementing new features in the tarfile module. -- components: Demos and Tools files: tar.py messages: 218867 nosy: berker.peksag, lars.gustaebel, serhiy.storchaka priority: normal severity: normal stage: test needed status: open title: Add Python implementation of the tar utility type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file35308/tar.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21550 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21550] Add Python implementation of the tar utility
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +Add the members parameter for TarFile.list() ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21550 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21549] Add the members parameter for TarFile.list()
Serhiy Storchaka added the comment: See issue21550 for example. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21549 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2506] Add mechanism to disable optimizations
Ned Batchelder added the comment: Python-Ideas thread started: https://mail.python.org/pipermail/python-ideas/2014-May/027893.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21550] Add Python implementation of the tar utility
Claudiu.Popa added the comment: I don't think that adding it to Tools/script helps that much on Windows at least. See issue21027 for reference. Except this, +1 from me. -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21550 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14776] Add SystemTap static markers
Jesús Cea Avión added the comment: I would. Just to point out that some dtrace weirdness like the stack walker is needed because dtrace probes are executed inside the OS kernel :-). Can we analyze case by case?. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14776 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21542] pprint doesn't work well for counters, sometimes shows them like a dict
akira added the comment: If it fits on a line then it seems Counter's repr is used: pprint(Counter({i:i*i for i in range(10)})) Counter({9: 81, 8: 64, 7: 49, 6: 36, 5: 25, 4: 16, 3: 9, 2: 4, 1: 1, 0: 0}) Otherwise It is shown as a dict (Counter is a dict subclass) if it is too large (multi-line): pprint(Counter({i:i*i for i in range(10)}), width=20) {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81} the behaviour is weird but pprint doesn't promise that custom objects such as Counter that can't be created using Python literals will be printed in a reversible manner. It seems there is a special support for some objects: pprint(frozenset({i for i in range(10)})) frozenset({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) pprint(frozenset({i for i in range(10)}), width=20) frozenset({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) Perhaps the support for Counter could be added using functools.singledispatch and/or __prettyprint__ hook from issue #7434 -- nosy: +akira ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21542 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7434] general pprint rewrite
akira added the comment: Related issue #21542: pprint support for multiline collections.Counter -- nosy: +akira ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7434 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21550] Add Python implementation of the tar utility
Brett Cannon added the comment: If this goes in then the CLI in the tarfile module should be removed. -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21550 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21525] Accept lists in Tkinter
Roundup Robot added the comment: New changeset 8676e436c0f0 by Serhiy Storchaka in branch 'default': Issue #21525: Most Tkinter methods which accepted tuples now accept lists too. http://hg.python.org/cpython/rev/8676e436c0f0 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21525 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21547] '!s' formatting documentation bug
Eric V. Smith added the comment: I suggest using whatever language explains what u'%s' %obj does. It's the same behavior. From the SO question, given: class A(object): def __str__(self): return 'as str' def __unicode__(self): return u'as unicode' Then: '%s' % A() 'as str' u'%s' % A() u'as unicode' and: '{!s}'.format(A()) 'as str' u'{!s}'.format(A()) u'as unicode' -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21547 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21525] Accept lists in Tkinter
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21525 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20035] Clean up Tcl library discovery in Tkinter on Windows
Zachary Ware added the comment: Ping. I still want to get this in, but not without a proper review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20035 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21538] plistlib unable to load iOS7 Safari History.plist
Ronald Oussoren added the comment: The patch looks good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21538 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21551] Behavior of word boundaries in regexes unexpected
New submission from Wellington Fan: Hello, It seems that the word boundary sequence -- r'\b' -- is not behaving as expected using re.split(). The regex docs say: \b Matches the empty string, but only at the start or end of a word. My (failing) test: import re re.split(r'\b', 'A funky string') ['A funky string'] We get a one-element array returned; I would expect a seven-element array: ['', 'A', ' ', 'funky', ' ', 'string', ''] I have equivalent code in PHP that *does* work: php print_r( preg_split('/\b/', 'A funny string') ); Array ( [0] = [1] = A [2] = [3] = funny [4] = [5] = string [6] = ) -- components: Regular Expressions messages: 218879 nosy: Wellington.Fan, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: Behavior of word boundaries in regexes unexpected type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21551 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21090] File read silently stops after EIO I/O error
Changes by Claudiu.Popa pcmantic...@gmail.com: -- nosy: -Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21090 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20035] Clean up Tcl library discovery in Tkinter on Windows
Serhiy Storchaka added the comment: I want to get this too, but perhaps there are some issues in a code. 1. Py_GetPrefix() returns wchar_t* string with maximal length MAXPATHLEN (defined in Include/osdefs.h as 256 on Windows). Then wcstombs() converts it to char* string. Are you sure that MAX_PATH (defined as 260 on Windows) is enough for converted string? I afraid that for multi-byte encoding it can be 2*MAXPATHLEN or even 3*MAXPATHLEN bytes. 2. After converting _tcl_library contains a path in locale encoding. And _putenv() works with it. I'm not sure, but I afraid that Tcl_SetVar() can expect UTF-8 encoded string. Please test with prefix containing non-ASCII characters (or even better with prefix containing East-Asian characters on East-Asian Windows). -- nosy: +haypo, scoder ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20035 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21551] Behavior of word boundaries in regexes unexpected
R. David Murray added the comment: Note that split will never split a string on an empty pattern match You can get what you want this way: re.split(r'(\w*)', 'a funky string') ['', 'a', ' ', 'funky', ' ', 'string', ''] Or use r'(\W*)' if you don't actually want the leading and training empty strings. -- nosy: +r.david.murray resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21551 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21551] Behavior of word boundaries in regexes unexpected
Matthew Barnett added the comment: See also issue #852532, issue #3262 and issue #988761. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21551 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8579] Add missing tests for FlushKey, LoadKey, and SaveKey in winreg
Claudiu.Popa added the comment: I'm working on this issue and I have a minimal patch ready, but it depends on issue21518, which proposes adding UnloadKey to winreg, so that we can unload the keys mounted with LoadKey. Also, that issue adds a mechanism for privilege acquisition, which I'll utilize for this issue. -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8579 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21542] pprint doesn't work well for counters, sometimes shows them like a dict
Raymond Hettinger added the comment: I think this tracker item should be subsumed by the effort to write a better pprint API. That would be better than trying to hack special cases into the current code which doesn't allow straight-forward customizations or extensions. I recommend this entry be closed as a known problem that is just one of many and needs to be solved in a much larger context. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21542 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21304] PEP 466: Backport hashlib.pbkdf2_hmac to Python 2.7
Alex Gaynor added the comment: Updated patch applies all of MAL's suggestions. Except the buffer() one, the purpose of the buffer() call is to make it an error to pass a list (or random other types) since you can call bytes() on any object. -- Added file: http://bugs.python.org/file35309/pbkdf2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21304 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21523] quadratic-time compilation in the number of 'and' or 'or' expressions
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21523 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21523] quadratic-time compilation in the number of 'and' or 'or' expressions
Antoine Pitrou added the comment: Andrew, have you tried to bisect the Mercurial repository to find where the regression was introduced? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21523 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21304] PEP 466: Backport hashlib.pbkdf2_hmac to Python 2.7
Alex Gaynor added the comment: As a note, the current code is basically identical to the code in Christain's backport, without the py3k compat. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21304 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19662] smtpd.py should not decode utf-8
Duke Dougal added the comment: Is this one likely to be included in 3.5? It effectively breaks smtpd so it would be good to see it working again. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19662 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21523] quadratic-time compilation in the number of 'and' or 'or' expressions
Andrew Dalke added the comment: Live and learn. I did my first bisect today. The first bad revision is: changeset: 51920:ef8fe9088696 branch: legacy-trunk parent: 51916:4e1556012584 user:Jeffrey Yasskin jyass...@gmail.com date:Sat Feb 28 19:03:21 2009 + summary: Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} with I confirmed that the parent did not have the problem. If you want me to diagnose this further, then I'll need some hints on what to do next. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21523 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21547] '!s' formatting documentation bug
Steven Barker added the comment: The behavior of !s with the format() methods isn't exactly the same as %s with % formatting. With the latter, the conversion depends on the type of the result string, which in turn depends on whether the format string *or any of the values values* is unicode: class X(): def __str__(self): return str def __unicode__(self): return uunicode %s %s % (foo, X()) 'foo str' %s %s % (ufoo, X()) u'foo unicode' u%s %s % (foo, X()) u'foo unicode' u%s %s % (ufoo, X()) u'foo unicode' The format methods are more consistent, always returning the same type as the format string regardless of the types of the arguments (and using the appropriate converter): {} {!s}.format(foo, X()) 'foo str' {} {!s}.format(ufoo, X()) 'foo str' u{} {!s}.format(foo, X()) u'foo unicode' u{} {!s}.format(ufoo, X()) u'foo unicode' The documentation for %s conversion (in the second table here: https://docs.python.org/2/library/stdtypes.html#string-formatting-operations ) also suggests that it always uses str(), though the footnote for that table entry alludes to the behavior shown above without ever mentioning using unicode() for conversions explicitly. -- nosy: +Steven.Barker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21547 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2506] Add mechanism to disable optimizations
Raymond Hettinger added the comment: Ned, why is your proposal to turn-off ALL peephole transformations with COMMAND-LINE switch? * Why not just turn-off the jump-to-jump? Do you really need to disable constant folding and other transformations? * Have you explored whether the peephole.c code can be changed to indicate the continue-statement was visited? * Why does this have to be a command-line setting rather than a flag or environment variable settable by coverage.py? * Is there some less radical way the coverage.py can be taught to make the continue-statement as visited? * Are you requesting that optimization constraints be placed on all of the implementations of Python (Jython, PyPy, and IronPython) to make coverage.py perfect? * Do you want to place limits on what can be done by Victor's proposed AST tranformations which will occur upstream from the peepholer and will make higher level semantically-neutral transformations *prior* to code generation. * Have you considered whether the genererated PYC files need a different magic number or some other way to indicate that they aren't production code? * If coverage.py produces a report on different code than the production run, doesn't that undermine some of the confidence the meaningfulness of the report? In other words, are you sure that you're making the right request and that it is really worth it? Do we really have to open this can of worms to make coverage.py happy? -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2506 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com