[issue13197] subprocess: move shell arguments to a separate keyword param

2014-05-15 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2014-05-15 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue1521950] shlex.split() does not tokenize like the shell

2014-05-15 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue1043134] Add preferred extensions for MIME types

2014-05-15 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons

2014-05-15 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue21514] update json module docs in light of RFC 7159 & ECMA-404

2014-05-15 Thread Chris Rebert
New submission from Chris Rebert: json module docs: https://docs.python.org/3/library/json.html New superseding JSON RFC: https://tools.ietf.org/html/rfc7159 Errata to the new RFC: http://www.rfc-editor.org/errata_search.php?rfc=7159 ECMA-404: http://www.ecma-international.org/publications/stand

[issue21509] json.load fails to read UTF-8 file with (BOM) Byte Order Marks

2014-05-15 Thread Chris Rebert
Chris Rebert added the comment: The new JSON RFC now at least mentions BOM handling: https://tools.ietf.org/html/rfc7159#section-8.1 : > Implementations MUST NOT add a byte order mark to the beginning of a > JSON text. In the interests of interoperability, implementations > that parse JSON texts

[issue13212] json library is decoding/encoding when it should not

2014-05-15 Thread Chris Rebert
Chris Rebert added the comment: Note that, per the new JSON RFC 7159 (https://tools.ietf.org/html/rfc7159 ), top-level non-collection values are now de-jure permissible in JSON: > Appendix A. Changes from RFC 4627 >o Changed the definition of "JSON text" so that it can be any JSON >

[issue19361] Specialize exceptions thrown by JSON parser

2014-05-15 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2014-05-15 Thread Chris Rebert
Changes by Chris Rebert : -- nosy: +cvrebert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue17909] Autodetecting JSON encoding

2014-05-15 Thread Chris Rebert
Chris Rebert added the comment: I agree that the state of encoding detection in the new RFC seems unclear, given that the old RFC prefaced the part about the encoding detection with: > Since the first two characters of a JSON text will always be ASCII > characters But in the new RFC: > Appendix

[issue17909] Autodetecting JSON encoding

2014-05-15 Thread akira
akira added the comment: Both json standard (ECMA-404) [1] and the new json rfc 7159 [2] do not mention the encoding detection. [1] http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf [2] https://tools.ietf.org/html/rfc7159#section-8.1 >From the rfc: > JSON text SHALL be

[issue21046] Document formulas used in statistics

2014-05-15 Thread Alextp
Alextp added the comment: @Ezio: of course, much of these funcs CANNOT be expressed as simple formulas. Only with some text. I shown example descriptions for almost all- above. -- ___ Python tracker __

[issue21507] set and frozenset constructor should use operator.length_hint to guess the size of the iterator

2014-05-15 Thread Josh Rosenberg
Josh Rosenberg added the comment: Not sure how much that really helps. If I understand you correctly, it would be a memory optimization that would require a round of rehashing to use? If you wanted to make a change that got "guaranteed" better performance, you might add support for dict's dict

[issue18104] Idle: make human-mediated GUI tests usable

2014-05-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0a6d51ccff54 by Terry Jan Reedy in branch '2.7': Issue #18104: revise docstrings, remove obsolete comments. http://hg.python.org/cpython/rev/0a6d51ccff54 New changeset 6d2982ff441f by Terry Jan Reedy in branch '3.4': Issue #18104: revise docstrings,

[issue21508] C API PyArg_ParseTuple doc is innacurate

2014-05-15 Thread Josh Rosenberg
Josh Rosenberg added the comment: Changing the docs isn't the main hurdle; the problem is that if we told people they could test == 1, rather than != 0, then new success return codes couldn't be added without a long period of warning. I don't think the convention is consistently 0 means succes

[issue21513] speed up some ipaddress properties

2014-05-15 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.rosenberg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread R. David Murray
R. David Murray added the comment: I mean redirect_stdout. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread R. David Murray
R. David Murray added the comment: Note that in 3.4 we have contextlib.replace_stdout, but it doesn't give any examples of how to construct file-like objects that will work well with it. -- ___ Python tracker

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The same situations people wrapped streams before on python 2: > > * code.py users. Werkzeug's traceback system implements a remote python > shell through it. > * any system that wants to unittest shell scripts on a high level. > * any system that wants to

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread Armin Ronacher
Armin Ronacher added the comment: Pretty much, yes. Just that you probably want 'replace' instead. surrogate-escape does not do anything useful here I think. -- ___ Python tracker ___

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread Armin Ronacher
Armin Ronacher added the comment: > I would like to know of some situations where you want to write some > code that accesses standard streams as binary *and* don't control the > application setup (i.e. library code rather than application code). It > seems to me that a library should take the bi

[issue21513] speed up some ipaddress properties

2014-05-15 Thread Antoine Pitrou
New submission from Antoine Pitrou: Some properties on IPv4Address and IPv6Address instantiate one or several network objects each time they are computed. Instead these characteristic networks can be computed once and for all at module import. Patch attached. (note: the lru_cache() decorator s

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > To avoid further problems may I also recommend documenting how exactly > people are supposed to wrap sys.stdout and so forth. Clearly putting > a StringIO there is insufficient as StringIO does not have a buffer. I would like to know of some situations where

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread Armin Ronacher
Armin Ronacher added the comment: To avoid further problems may I also recommend documenting how exactly people are supposed to wrap sys.stdout and so forth. Clearly putting a StringIO there is insufficient as StringIO does not have a buffer. Something like this maybe? import io buf = io.Byt

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the report, Armin. I've removed that recommendation and changed the surrounding wording to insist that standard streams are always text streams. -- resolution: -> fixed stage: -> resolved status: open -> closed

[issue21364] Documentation Recommends Broken Pattern

2014-05-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4621bb82ceec by Antoine Pitrou in branch '3.4': Issue #21364: remove recommendation of broken pattern. http://hg.python.org/cpython/rev/4621bb82ceec New changeset dbf728f9a2f0 by Antoine Pitrou in branch 'default': Issue #21364: remove recommendatio

[issue15809] 2.7 IDLE console uses incorrect encoding.

2014-05-15 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- nosy: -loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue21486] optimize v4 & v6 netmask parsing

2014-05-15 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue21487] Assorted ipaddress performance improvements

2014-05-15 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-05-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've now committed this. exhuma, if you have any further observations or results, don't hesitate to post them! -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker

[issue20826] Faster implementation to collapse consecutive ip-networks

2014-05-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8867874a2b7d by Antoine Pitrou in branch 'default': Issue #20826: Optimize ipaddress.collapse_addresses(). http://hg.python.org/cpython/rev/8867874a2b7d -- nosy: +python-dev ___ Python tracker

[issue15809] 2.7 IDLE console uses incorrect encoding.

2014-05-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Idle 3.x has Martin's patch, except that the 'if' clause is merely commented out rather than removed. (Perhaps someone wanted to test the removal first. It should now be deleted.) My 2.7 Idle has Default Source Encoding ... [x] None. Since there is nothing f

[issue21487] Assorted ipaddress performance improvements

2014-05-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2711677cf874 by Antoine Pitrou in branch 'default': Issue #21487: Optimize ipaddress.summarize_address_range() and ipaddress.{IPv4Network,IPv6Network}.subnets(). http://hg.python.org/cpython/rev/2711677cf874 -- nosy: +python-dev __

[issue21486] optimize v4 & v6 netmask parsing

2014-05-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2158614e1607 by Antoine Pitrou in branch 'default': Issue #21486: Optimize parsing of netmasks in ipaddress.IPv4Network and ipaddress.IPv6Network. http://hg.python.org/cpython/rev/2158614e1607 -- nosy: +python-dev _

[issue21512] time module becomes None after raise SystemExit

2014-05-15 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: not a bug -> wont fix status: open -> closed ___ Python tracker ___ ___ Python-bugs-list ma

[issue21512] time module becomes None after raise SystemExit

2014-05-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, let's call it a limitation rather than a bug. When creating a global variable (such as "a" in your example), that variable is kept alive at least as long as the module containing it. However, modules usually live until very late in the interpreter shutdow

[issue21512] time module becomes None after raise SystemExit

2014-05-15 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +benjamin.peterson, pitrou resolution: -> not a bug status: open -> pending ___ Python tracker ___ ___

[issue21512] time module becomes None after raise SystemExit

2014-05-15 Thread Ryder Lewis
New submission from Ryder Lewis: I'm not sure if this is a bug or expected behavior, but basically what I want to do is log the timestamp when an application exits. Sample script to illustrate the issue: try.py import time class A(): def __init__(self): print("Initializi

[issue21511] Thinko in Lib/quopri.py

2014-05-15 Thread Paul Sokolovsky
New submission from Paul Sokolovsky: Lib/quopri.py for version 3.3..3.5-tip contains following code: ESCAPE = b'=' ... line = input.readline() if not line: break i, n = 0, len(line) if n > 0 and line[n-1:n] == b'\n': ... elif i+1 < n and line[i+1] == E

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But an exception reports about CP_UTF8. -- title: disallow the "surrogatepass" handler for non utf-* encodings -> disallow the "surrogatepass" handler for non utf-* encodings ___ Python tracker

[issue17909] Autodetecting JSON encoding

2014-05-15 Thread Chris Rebert
Chris Rebert added the comment: You'll need to also update the "Character Encodings" subsection of the json docs. -- ___ Python tracker ___ _

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread STINNER Victor
STINNER Victor added the comment: > Here is a patch, which adds support for cp65001 The name of the encoding is "cp65001", not something like "cp-utf8". And there is no alias like "cp_65001", there is only "cp65001". -- ___ Python tracker

[issue21508] C API PyArg_ParseTuple doc is innacurate

2014-05-15 Thread Steve
Steve added the comment: I would prefer the function to return "bool". But what I prefer is irrelevant, what counts is accuracy and clarity. And to this end, the return type and the comment have to match. For a int return value, the document should mention a condition relative to an integer

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch, which adds support for cp65001 and fixes test_cp1252. Please test it on Windows Vista. Lone surrogates are not illegal in UTF-7 (see RFC 1642), so error handler is not called and explicit support of UTF-7 is not needed. Could you please hel

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread STINNER Victor
STINNER Victor added the comment: Windows buildbots are unhappy. http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/8355/steps/test/logs/stdio == ERROR: test_surrogatepass_handler (test.test_codecs.CP65001Test)

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread STINNER Victor
STINNER Victor added the comment: It makes sense to restrict surrogatepass to UTF-* encodings. UTF-8, UTF-16 and UTF-32 encoders reject surrogate characters, but not UTF-7. Is it a bug? I'm asking because PyCodec_SurrogatePassErrors() doesn't support UTF-7. IMO your change is important enough

[issue21486] optimize v4 & v6 netmask parsing

2014-05-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, using lru_cache(maxsize=None) would enable a simple infinite cache like in the patch. But it's not like a lot of code would be saved. -- ___ Python tracker _

[issue21486] optimize v4 & v6 netmask parsing

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What I want to say, the patch LGTM, but after committing issue14373 we should simplify the code by using functools.lru_cache(). -- ___ Python tracker ___

[issue17909] Autodetecting JSON encoding

2014-05-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file30133/json_detect_encoding.patch ___ Python tracker ___ ___ Python-bugs

[issue21487] Assorted ipaddress performance improvements

2014-05-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: I find logical operations on negative numbers confusing in Python, so I'd rather stick with the first implementation. -- ___ Python tracker ___

[issue17909] Autodetecting JSON encoding

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All dependencies for this issue are resolved now. Here is updated patch, synchronized with tip. -- Added file: http://bugs.python.org/file35258/json_detect_encoding_2.patch ___ Python tracker

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ __

[issue21510] fma documentation should provide better example.

2014-05-15 Thread Jayanth Koushik
Jayanth Koushik added the comment: @Mark: I agree. And perhaps it is also worth mentioning (on an unrelated note), that the decimal fma is not based on the internal cmath fma (it could not be) and unlike the cmath fma, it is no faster than an unfused multiply-add. -- _

[issue21510] fma documentation should provide better example.

2014-05-15 Thread Mark Dickinson
Mark Dickinson added the comment: I wouldn't want to drop the simple example: I suspect that many of those looking at fma won't have the first idea what it does, and that first example shows clearly that it's a fused multiply-add. But +1 for an example that demonstrates the single rounding, ei

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5e98a50e0f55 by Serhiy Storchaka in branch 'default': Issue #13916: Disallowed the surrogatepass error handler for non UTF-* http://hg.python.org/cpython/rev/5e98a50e0f55 -- nosy: +python-dev ___ Python t

[issue21510] fma documentation should provide better example.

2014-05-15 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson, skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread Martin v . Löwis
Martin v. Löwis added the comment: LGTM -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry. -- keywords: +patch Added file: http://bugs.python.org/file35257/surrogatepass_non_utf.patch ___ Python tracker ___ ___

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka wrote: > Here is a patch I don't see your patch. -- ___ Python tracker ___ ___ Pyt

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which disallows the surrogatepass handler for non-utf encodings. Please test it on Windows. -- type: behavior -> enhancement versions: +Python 3.5 -Python 3.1, Python 3.2, Python 3.3 ___ Python trac

[issue15809] 2.7 IDLE console uses incorrect encoding.

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Alternative solution is to force UTF-8 in IDLE console. But I think this will be more surprising, especially for Windows users. -- ___ Python tracker ___

[issue19186] expat symbols should be namespaced in pyexpat again

2014-05-15 Thread Peter Kruse
Peter Kruse added the comment: Fascinating, you are right, very good, thanks for your time and looking into this. Peter -- ___ Python tracker ___ __

[issue17909] Autodetecting JSON encoding

2014-05-15 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This issue was mainly resolved in issue12892. The surrogatepass error handler now works with UTF-16* and UTF-32* encodings. But for other encodings it behaves as for UTF-8 (preserve old behavior). Should we change the behavior for non-UTF encodings end raise

[issue19837] Wire protocol encoding for the JSON module

2014-05-15 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue21027] difflib new cli interface

2014-05-15 Thread STINNER Victor
STINNER Victor added the comment: > After more thought, I think this should remain in tools as a demo. I disagree, I like the command line interface. It's very useful on Windows for example. It's also useful on UNIX embedded devices where Python is installed, but only a few UNIX tools. If you

[issue21507] set and frozenset constructor should use operator.length_hint to guess the size of the iterator

2014-05-15 Thread STINNER Victor
STINNER Victor added the comment: "I think the argument against using PyObject_LengthHint for the general iterable case is that for inputs other than sets or dicts, the assumption is that significant deduplication will occur." Oh... I'm dumb :) Sorry. Another option for frozenset only: we may

[issue21509] json.load fails to read UTF-8 file with (BOM) Byte Order Marks

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Currently json.load/loads don't support binary input. See issue17909 and issue19837. -- ___ Python tracker ___ __

[issue21507] set and frozenset constructor should use operator.length_hint to guess the size of the iterator

2014-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree with Josh's arguments. Similar idea was already proposed and rejected (issue17338). -- ___ Python tracker ___ ___