[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 are what __format__() method was intended to 
address.

If you want to go further, it would be reasonable to bring 
https://bugs.python.org/issue8060 back to life.  The final entry in that 
tracker item recommended moving the discussion to python ideas or into a PEP 
(like was done for the thousands separator format option).  There are many 
viewpoints to consider before jumping to codify one particular approach into 
the standard library.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: Linux 2.6.32) => /usr/lib32/libm.so.6\n'

Perhaps the abi_type check needs to be moved in front of the path name 
extraction.

For the version, I would put 3.6. Since this changes documented behaviour and 
has the potential to break compatibilty, it is best not to change it in a bug 
fix release. (3.5 has already been released.)

The problem with the test() function in ctypes.util is that it is not run by 
the main Python regression test suite. The tests under ctypes/test/ are run by 
the test suite.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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]+' % re.escape(_LegalChars)).fullmatch
>>> Timer("is_legal_key(random_str)", setup="from __main__ import random_str, 
>>> is_legal_key").timeit(1)
0.316825238437
>>> def is_legal_key(key):
... return key and set(_LegalChars).issuperset(key)
... 
>>> Timer("is_legal_key(random_str)", setup="from __main__ import random_str, 
>>> is_legal_key").timeit(1)
4.3335622880001665


Also, I have updated the patch. Can you please review it? :)

--
Added file: http://bugs.python.org/file41841/issue26302_20160207.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 enable them (2.2 and 2.5). But currently 
ASYNC and AWAIT are in Grammar as what I believe are special tokens, rather 
than normal keywords.

Depending on the purpose of the syntax highlighting or code analysis, it might 
be better for these to be listed as keywords now, rather than waiting until 3.7.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
> different input variable. But it is strange that _LegalKeyChars lists a
> comma, but _LegalChars omits it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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" names imply that it's safe if the original
> reference is NULL. This isn't an objection to the names, but if
> it is given one of those names I think it should use Py_XDECREF.

It was my initial intension. But then I had got a number of voices for single 
macros.

On 16.12.15 23:16, Victor Stinner wrote:
> I would prefer a single macro to avoid bugs, I don't think that such
> macro has a critical impact on performances. It's more designed for
> safety, no?

On 17.12.15 08:22, Nick Coghlan wrote:
>> 1. Py_SETREF
>
> +1 if it always uses Py_XDECREF on the previous value (as I'd expect
> this to work even if the previous value was NULL)

Some objections were repeated by their authors few times. And I had no one 
voice for separate macros (except my).

In the light of your objection we should reraise this issue on Python-Dev.

Now, after applying patches, it would be harder to split Py_SETREF on two 
macros. But I tried to not replace a Py_DECREF with a Py_SETREF in performance 
critical code (e.g. in PyDict_SetItem).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
http://bugs.python.org/file41802/telco_haypo.py.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26284] Fix telco benchmark

2016-02-07 Thread Stefan Krah

Changes by Stefan Krah :


--
title: FIx telco benchmark -> Fix telco benchmark

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.  And you can see a huge improvement in various timeit 
micro-benchmarks.

fastint5 is a very compact patch, that only touches the ceval.c file.  It 
doesn't complicate the code, as the macro is very straightforward.  Since the 
patch passed the code review, thorough benchmarking and discussion stages, I'd 
like to commit it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 will benchmarks suite show.  I can 
assist with writing some code for stats, but what's the plan?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 3.6 -Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 the default, the way to do this is by creating a 
subclass and changing its behaviour appropriately.

IMO the accepted SO answer you linked to doesn't give correct advice.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25459] EAGAIN errors in Python logging module

2016-02-07 Thread Vinay Sajip

Vinay Sajip added the comment:

The problem with your suggested fix is that if you keep getting EAGAIN, the 
handler will appear to hang. If you want to suggest that maybe we limit the 
number of tries, then what number of retries would you pick, and why? Also, a 
caller might want to know about EAGAIN, so I'm not sure you'd want to 
(effectively) swallow it in the handler.

Perhaps a different strategy (than just trying for ever) would be better. If 
you know the application is unusual in having a SIGPIPE handler and you think 
this is a contributory factor, why not just subclass the handler, add a more 
resilient emit() and use that in your application?

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-02-07 Thread SilentGhost

Changes by SilentGhost :


--
stage:  -> resolved

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 comparing apples to oranges.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26289] Optimize floor division for ints

2016-02-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added comments on Rietveld.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 you use?  What were the numbers?  I'm asking because before 
you benchmarked different patches that are conceptually similar to fastint5, 
and the result was that decimal was 5% faster with fast paths for just longs, 
and 6% slower with fast paths for longs & floats.

Also, some quick timeit results (quite stable from run to run):


-m timeit -s "x=2" "x + 10 + x * 20  + x* 10 + 20 -x"
3.6: 0.150usec   3.6+fastint: 0.112usec


-m timeit -s "x=2" "x*2.2 + 2 + x*2.5 + 1.0 - x / 2.0 + (x+0.1)/(x-0.1)*2 + 
(x+10)*(x-30)"
3.6: 0.425usec   3.6+fastint: 0.302usec

--
Added file: http://bugs.python.org/file41843/fastint6.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: Fixed error messages for some argument parsing errors.
https://hg.python.org/cpython/rev/9f998e24d8d8

New changeset f8bdc0ea3bcf by Serhiy Storchaka in branch 'default':
Issue #26198: Fixed error messages for some argument parsing errors.
https://hg.python.org/cpython/rev/f8bdc0ea3bcf

New changeset 53d66a554beb by Serhiy Storchaka in branch 'default':
Issue #26198: ValueError is now raised instead of TypeError on buffer
https://hg.python.org/cpython/rev/53d66a554beb

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 slice getting.

3) Add slice assignment and deleting. I'm not sure that this is needed for 
deque.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
https://hg.python.org/cpython/file/v3.5.1/Lib/unittest/mock.py#l2028

This leads me to this changeset:
https://hg.python.org/cpython/rev/3603bae63c13


My failing test:

from unittest import mock

call1 = mock.call(mock.MagicMock())
call2 = mock.call(mock.ANY)

assert call1 == call2
assert not (call1 != call2)

This passes in 3.4 but fails in 3.5, but fails on the second assert, not the 
first. So they are equal, but they're not not-equal. I've added this as a test 
and reinstated __ne__ in my patch.

--
keywords: +patch
nosy: +Andrew Plummer
Added file: http://bugs.python.org/file41844/fix_mock_call_ne.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-02-07 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 behaviour, but that's a quality of implementation question 
in the code handling the introspection.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 UTC in date/time documentation

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 programs). Though you might also consider how easy it 
would be to write a wrapper function around Path.glob() that implements this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: __format__() argument 1 must be str, not int

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/var/lib/buildbot/slaves/profile-opt-bot/3.5.gps-debian-profile-opt/build/Lib/test/datetimetester.py",
 line 1578, in test_format
dt.__format__(123)
AssertionError: "^must be str, not int$" does not match "__format__() argument 
1 must be str, not int"

http://buildbot.python.org/all/builders/AMD64%20Debian%20PGO%203.5/builds/632/steps/test/logs/stdio

http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/10486/steps/test/logs/stdio

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 14:23, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka added the comment:
> 
> Benjamin, could you please make a review?
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 raise CookieError and fail to set the invalid cookie 
“morsel”, and the ones that come after it.

There seems to be a disconnect between _LegalChars (causes the CookieError if a 
comma is in a cookie key name) and _LegalKeyChars (allows a comma, but causes 
cookie string parsing to silently abort for other illegal characters).

There are other cases where the entire cookie string is rejected, specifically 
added by Issue 22796 (revision a065ab1c67a8).

On the other hand, Issue 25228 has a which has a patch to skip over some 
invalid cookie “morsels” and continue on to valid ones.

--
nosy: +martin.panter
title: Handle malformed cookie -> http.cookies: Handle malformed cookie

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 of some other cookie value. Suppose the “c=d” 
text was meant to be associated with the “message” key. Before the security 
fix, “c=d” is separated:

>>> SimpleCookie('a=b; messages=[""]c=d;')


With the fix applied, we now silently abort the parsing, and there is no 
spurious “c” key:

>>> SimpleCookie('a=b; messages=[""]c=d;')


This also seems to be described by Sergey Bobrov in Russian at 
.

Looking at the proposed patch again, I think the fix might be okay. Some 
specifications for cookies allow semicolons to be quoted or escaped, and I was 
a bit worried that this might be a problem. But all the scenarios I can imagine 
would be no worse with the patch compared to without it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 error tests more lenient.
https://hg.python.org/cpython/rev/a9c9e4054f3f

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 awkward to me, although the meaning is 
clear. This question & answer 

 seem to back me up, but I thought I should get a quick review or second 
opinion before changing everything.

--
assignee: docs@python
components: Documentation
files: allows-to.patch
keywords: patch
messages: 259827
nosy: docs@python, martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Fix “allows to ” in documentation
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41845/allows-to.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 standard lib?

--
nosy: +mahmoud

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com