[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Berker. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue7359] mailbox cannot modify mailboxes in system mail spool

2016-02-07 Thread Mahmoud Hashemi
Mahmoud Hashemi added the comment: Got bit by this, and since it's not a bug, here's "not" a fix: http://boltons.readthedocs.org/en/latest/mboxutils.html#boltons.mboxutils.mbox_readonlydir Been in production for a while, working like a charm. Might there be interest in including this in the

[issue26304] Fix “allows to ” in documentation

2016-02-07 Thread Martin Panter
New submission from Martin Panter: This patch changes instances of “. . . allows to ” to “. . . allows ing” or similar. I understand the original form is not correct English grammar, although the equivalent is apparently valid in some other languages. As a native English speaker it feels

[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-02-07 Thread Martin Panter
Martin Panter added the comment: The ABI matching looks wrong to me. If I am looking for a 32-bit library, won’t it incorrectly catch the wrong path in the following “ldconfig -p” output: '\tlibm.so.6 (libc6,x86-64, OS ABI: Linux 2.6.32) => /usr/lib/libm.so.6\n' '\tlibm.so.6 (libc6, OS ABI:

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm disinclined to make a new method and instead prefer to go the route of having a formatting option. For the most part, we want the methods to be limited to those in the spec (the API is already huge). The other reason is that output formatting options

[issue26294] Queue().unfinished_tasks not in docs - deliberate?

2016-02-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger nosy: +rhettinger ___ Python tracker ___

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-02-07 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- status: open -> closed ___ Python tracker ___

[issue26294] Queue().unfinished_tasks not in docs - deliberate?

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Just as you thought, the 'unfinished_tasks' attribute not intended to be part of the public API for queues. -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue26264] keyword module missing async and await keywords

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: It shouldn't go into keywords.py until it is actually a keyword. Keywords is used for many purposes including syntax highlighting and code analysis tools. -- assignee: rhettinger -> resolution: -> not a bug

[issue26200] SETREF adds unnecessary work in some cases

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: If you don't add an XSETREF variant, I think you should revert the instances where a Py_DECREF was downgraded to Py_XDECREF. -- ___ Python tracker

[issue24421] Race condition compiling Modules/_math.c

2016-02-07 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___

[issue26298] Split ceval.c into small files

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm also -1 on the split for the reasons listed by Brett and Serhiy. -- nosy: +rhettinger ___ Python tracker ___

[issue26282] Add support for partial keyword arguments in extension functions

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for this suggestion. There are a number of places where we've been trapped between having no keyword arguments or having to use keywords for all arguments even when it doesn't make sense to have all arguments be keywords. -- nosy: +rhettinger

[issue26204] compiler: ignore constants used as statements? (don't emit LOAD_CONST+POP_TOP)

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue26264] keyword module missing async and await keywords

2016-02-07 Thread Martin Panter
Martin Panter added the comment: To answer my question, it looks like the keywords.py list is automatically generated (by running the script) from Python/graminit.c, in turn generated from Grammar/Grammar. “Yield” and “with” were always listed even when the __future__ statement was needed to

[issue26302] cookies module allows commas in keys

2016-02-07 Thread Martin Panter
Martin Panter added the comment: The same bug is in the _CookiePattern regular expression. For illegal characters other than a comma, the CookieError does not actually seem to be raised. -- ___ Python tracker

[issue25226] "suffix" attribute not documented in logging.TimedRotatingFileHandler

2016-02-07 Thread SilentGhost
SilentGhost added the comment: It isn't documented because it's an internal attribute. If it did work for someone, it's by accident. Naturally, Vinay would have to make a final judgement regarding this, but I'd be inclined to close as not a bug. -- nosy: +SilentGhost

[issue24950] FAIL: test_expanduser when $HOME=/

2016-02-07 Thread SilentGhost
SilentGhost added the comment: Here is the patch that addresses the issue in both tests. Felix, could you test it? -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file41842/issue24950.diff ___ Python tracker

[issue26284] FIx telco benchmark

2016-02-07 Thread Stefan Krah
Stefan Krah added the comment: Unfortunately, replacing io.BytesIO(data) with indexing does not make the benchmark faster or more stable on my machine. BTW, string conversion of the result is actually a crucial part of the benchmark, it was taken out in

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-07 Thread Stefan Krah
Stefan Krah added the comment: #26288 brought a great speedup for floats. With fastint5_4.patch *on top of #26288* I see no improvement for floats and a big slowdown for _decimal. -- ___ Python tracker

[issue26302] cookies module allows commas in keys

2016-02-07 Thread Anish Shah
Anish Shah added the comment: I ran regex and issuperset version on a random string. The regex one gives better performance. So, I have included the re.escape in the patch. >>> random_str = ''.join(random.choice(_LegalChars) for _ in range(10 ** 8)) >>> is_legal_key = re.compile('[%s]+' %

[issue26302] cookies module allows commas in keys

2016-02-07 Thread Martin Panter
Martin Panter added the comment: I take that back about _CookiePattern having the same bug; it uses a different input variable. But it is strange that _LegalKeyChars lists a comma, but _LegalChars omits it. -- ___ Python tracker

[issue26302] cookies module allows commas in keys

2016-02-07 Thread Anish Shah
Anish Shah added the comment: _LegalKeyChars contains "\-" whereas _LegalChars just contains "-". On Sun, Feb 7, 2016 at 4:33 PM, Martin Panter wrote: > > Martin Panter added the comment: > > I take that back about _CookiePattern having the same bug; it uses a >

[issue26299] wsgiref.util FileWrapper raises ValueError: I/O operation on closed file.

2016-02-07 Thread SilentGhost
Changes by SilentGhost : -- nosy: +pje versions: +Python 3.6 -Python 3.4 ___ Python tracker ___

[issue24950] FAIL: test_expanduser when $HOME=/

2016-02-07 Thread SilentGhost
SilentGhost added the comment: > What if HOME is "//"? Is this possible? What would be the result of these tests? Would they fail? As far as I understand my patch is just fixing problem introduced by fixes from issue 17809. -- ___ Python tracker

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-07 Thread Yury Selivanov
Yury Selivanov added the comment: >From what I can see there is no negative impact of the patch on stable macro >benchmarks. There is quite a detectable positive impact on most of integer and float operations from my patch. 13-16% on nbody and spectral_norm benchmarks is still impressive.

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please don't commit it right now. Yes, due to using macros the patch looks simple, but macros expanded to complex code. We need more statistics. -- ___ Python tracker

[issue26200] SETREF adds unnecessary work in some cases

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: On 28.02.14 15:58, Kristján Valur Jónsson wrote: > Also, for the equivalence to hold there is no separate Py_XSETREF, the X > behaviour is implied, which I favour. Enough of this X-proliferation > already! On 16.12.15 16:53, Random832 wrote: > I think "SET"

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-07 Thread Stefan Krah
Stefan Krah added the comment: Well I *did* run the decimal/float milli-benchmark now and it shows at least 15% improvement for floats consistently. Given that the official benchmark suite does not seem to be very stable either (#21955), I actually prefer small and well-understood benchmarks.

[issue24950] FAIL: test_expanduser when $HOME=/

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What if HOME is "//"? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue26284] Fix telco benchmark

2016-02-07 Thread Stefan Krah
Changes by Stefan Krah : -- title: FIx telco benchmark -> Fix telco benchmark ___ Python tracker ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-07 Thread Yury Selivanov
Yury Selivanov added the comment: > Please don't commit it right now. Yes, due to using macros the patch looks > simple, but macros expanded to complex code. We need more statistics. But what you will use to gather statistics data? Test suite isn't representative, and we already know what

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-07 Thread Stefan Krah
Stefan Krah added the comment: The comment looks good to me -- I'll stay out of the benchmarking issue, I didn't check any of that. :) -- ___ Python tracker

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Be careful with test suites: first, they might exercise code that would never be a critical point for performance in a real-world application; second and most important, unittest seems to have gotten slower between 2.x and 3.x, so you would really be

[issue26039] More flexibility in zipfile interface

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed zipinfo-from-file5.patch. Now I'm starting to review zipfile-open-w4.patch (I concurred with most Martin's comments for previous patches). -- ___ Python tracker

[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Martin, Antoine, what would you say about this? -- ___ Python tracker ___

[issue26289] Optimize floor division for ints

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added comments on Rietveld. -- ___ Python tracker ___ ___

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-07 Thread Yury Selivanov
Yury Selivanov added the comment: Attaching another patch - fastint6.patch that only optimizes longs (no FP fast path). > #26288 brought a great speedup for floats. With fastint5_4.patch *on top of > #26288* I see no improvement for floats and a big slowdown for _decimal. What benchmark did

[issue26039] More flexibility in zipfile interface

2016-02-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7fea2cebc604 by Serhiy Storchaka in branch 'default': Issue #26039: Added zipfile.ZipInfo.from_file() and zipinfo.ZipInfo.is_dir(). https://hg.python.org/cpython/rev/7fea2cebc604 -- nosy: +python-dev ___

[issue25698] The copy_reg module becomes unexpectedly empty in test_cpickle

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Benjamin, could you please make a review? -- ___ Python tracker ___ ___

[issue8060] PEP 3101 string formatting missing engineering presentation type for floating point

2016-02-07 Thread Serge Stroobandt
Serge Stroobandt added the comment: As per https://bugs.python.org/issue26223#msg259772 , can we please reopen this? I kind of hate it when *real* issues are kept closed for years (6!) until another lost soul comes by with the same itch... -- nosy: +serge.stroobandt versions: +Python

[issue25295] functools.lru_cache raises KeyError

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seems this issue can be closed now. -- ___ Python tracker ___ ___

[issue15731] Mechanism for inheriting docstrings and signatures

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After issue15582, is it still actual? -- ___ Python tracker ___ ___

[issue25226] "suffix" attribute not documented in logging.TimedRotatingFileHandler

2016-02-07 Thread Vinay Sajip
Vinay Sajip added the comment: It's not documented, and not intended to be changeable by the user, because it is not set to a fixed value - the value depends on the "when" (to rollover) and "interval" arguments to the handler initializer. If you really need to have functionality other than

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-07 Thread Case Van Horsen
Case Van Horsen added the comment: Can I suggest the mpmath test suite as a good benchmark? I've used it to test the various optimizations in gmpy2 and it has always been a valuable real-world benchmark. And it is slower in Python 3 than Python 2 --

[issue26297] Move constant folding to AST level

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Issue1346238 has a patch. -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> A constant folding optimization pass for the AST ___ Python tracker

[issue21536] extension built with a shared python cannot be loaded with a static python

2016-02-07 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___

[issue25007] Add support of copy protocol to zlib compressors and decompressors

2016-02-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: -> needs patch ___ Python tracker ___ ___

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-02-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset ab25ce400abd by Serhiy Storchaka in branch '2.7': Issue #26198: Fixed error messages for some argument parsing errors. https://hg.python.org/cpython/rev/ab25ce400abd New changeset 9f998e24d8d8 by Serhiy Storchaka in branch '3.5': Issue #26198:

[issue25156] shutil.copyfile should internally use os.sendfile when possible

2016-02-07 Thread desbma
desbma added the comment: If anyone is interested, I have created a package to monkey patch shutil.copyfile to benefit from sendfile, similarly to the last patch, but it also works on older Python versions down to 2.7. PyPI link: https://pypi.python.org/pypi/pyfastcopy/ --

[issue17394] Add slicing support to collections.deque

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since the patch is so complex, I suggest to split it on parts, and review and commit them separately: 1) Refactoring. Extract common code to macros and utility functions. These macros can be used for more efficient implementing insert() and __del__. 2) Add

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2016-02-07 Thread Andrew Plummer
Andrew Plummer added the comment: I've had a look and I think this could be because the class _Call (also in unittest.mock) has lost its __ne__ method between 3.4 and 3.5. Compare https://hg.python.org/cpython/file/v3.4.4/Lib/unittest/mock.py#l2010 with

[issue17394] Add slicing support to collections.deque

2016-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm already underway for the review. The "refactoring" part is making is more difficult. We just need slicing support to be added. Yes, I do want slice assignment and deletion. The output should be a deque, not a list. --

[issue15731] Mechanism for inheriting docstrings and signatures

2016-02-07 Thread Nick Coghlan
Nick Coghlan added the comment: Agreed, making it easy to follow the inheritance chains at docstring lookup time means it would be redundant to duplicate them at class definition time. Code that interrogates __doc__ directly rather than using inspect.getdoc won't benefit from the new

[issue8810] TZ offset description is unclear in docs

2016-02-07 Thread Nick Coghlan
Nick Coghlan added the comment: I agree it makes sense to merge this and #9305, and since the latter has seen more recent activity, I'll do the merge in that direction. -- resolution: -> duplicate stage: patch review -> status: open -> closed superseder: -> Don't use east/west of

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2016-02-07 Thread Berker Peksag
Berker Peksag added the comment: Looks like _Call is a subclass of tuple. Checks in the test could be written as "self.assertIs(a == b, True)". -- nosy: +berker.peksag stage: -> patch review versions: +Python 3.6 ___ Python tracker

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2016-02-07 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue26096] '*' glob string matches dot files in pathlib

2016-02-07 Thread Guido van Rossum
Guido van Rossum added the comment: If you really need an easy way to provide what the shell offers to end users, maybe you could submit a patch that adds an option similar to "GLOBIGNORE" in bash (but the default would be to return everything, which is more regular and more useful for Python

[issue19869] BaseCookie does not complain if a non RFC compliant cookie header was given

2016-02-07 Thread Martin Panter
Martin Panter added the comment: Due to the change in Issue 22796, a key without a value (“httponly,” in the example) now causes the parsing operation to be silently aborted. Perhaps we can close this? -- nosy: +martin.panter ___ Python tracker

[issue22983] Cookie parsing should be more permissive

2016-02-07 Thread Martin Panter
Martin Panter added the comment: The patch at Issue 25228 should partially do what Demian proposed. Anyway, I think Issue 17340 is basically about the same problem. -- nosy: +martin.panter resolution: -> duplicate status: open -> closed superseder: -> Handle malformed cookie

[issue25698] The copy_reg module becomes unexpectedly empty in test_cpickle

2016-02-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: I don't think this patch is the best way. The correct way is to have and use PyDict_GetWithError. I wouldn't be surprised if you could crash Python under this patch by putting some function with an import in __cmp__ in sys.modules. On Sun, Feb 7, 2016, at

[issue25228] Regression in cookie parsing with brackets and quotes

2016-02-07 Thread Martin Panter
Martin Panter added the comment: Looking at this a second time, I think I have figured out what the security report was about. Before the fix (before revision 270f61ec1157), an attacker could trick the parser into accepting a separate key=value cookie “morsel”, when it was supposed to be part

[issue26302] cookies module allows commas in keys

2016-02-07 Thread Martin Panter
Martin Panter added the comment: The patch looks okay to me. The inconsistency between silently rejecting cookie “morsels” and raising an exception from load() also exists in 2.7, so maybe it is not a big deal. -- ___ Python tracker

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-02-07 Thread Berker Peksag
Berker Peksag added the comment: test_datetime is broken on 3.5 and default: == FAIL: test_format (test.datetimetester.TestSubclassDateTime) -- TypeError:

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2016-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be better to use just default implementation: __ne__ = object.__ne__ Interesting that while call1 == call2 is True, call2 == call1 is False. But this is different issue. -- ___ Python tracker

[issue17340] http.cookies: Handle malformed cookie

2016-02-07 Thread Martin Panter
Martin Panter added the comment: The current Python 3.5 and default branches actually seem to parse the test case given: >>> c = SimpleCookie() >>> c.load(",BRIDGE_R=; a=b; user_id=1;") >>> c But that is just a side effect of Issue 26302. When that is fixed, parsing the cookie string will

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-02-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 22b0a63808f8 by Serhiy Storchaka in branch '3.5': Issue #26198: Make datetime error tests more lenient. https://hg.python.org/cpython/rev/22b0a63808f8 New changeset a9c9e4054f3f by Serhiy Storchaka in branch 'default': Issue #26198: Make datetime