[issue25770] expose name, args, and kwargs from methodcaller

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

functools.partial() is unique in it's usage of name "keywords".

--
nosy: +ncoghlan, rhettinger

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2015-12-02 Thread Robert Kuska

Robert Kuska added the comment:

With Python-3.5 and COUNT_ALLOCS enabled following new tests fail also:


FAIL: test_is_finalizing (test.test_sys.SysModuleTest)
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.5.0/Lib/test/test_sys.py", line 767, in 
test_is_finalizing
self.assertEqual(stdout.rstrip(), b'True')
AssertionError: b'' != b'True'
-

==
FAIL: test_print_traceback_at_exit (test.test_traceback.SyntaxTracebackCases)
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.5.0/Lib/test/test_traceback.py", line 
210, in test_print_traceback_at_exit
self.assertEqual(stderr.splitlines(), expected)
AssertionError: Lists differ: [] != [b'Traceback (most recent call last):', 
b'[75 chars]ero']
Second list contains 3 additional elements.
First extra element 0:
b'Traceback (most recent call last):'
- []
+ [b'Traceback (most recent call last):',
+  b'  File "", line 8, in __init__',
+  b'ZeroDivisionError: division by zero']

--
nosy: +rkuska

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2015-12-02 Thread STINNER Victor

STINNER Victor added the comment:

COUNT_ALLOCS was added 22 years ago. I guess that the usecase is to track 
memory leaks, right?

branch:  legacy-trunk
user:Sjoerd Mullender 
date:Mon Oct 11 12:54:31 1993 +
files:   Include/object.h Modules/arraymodule.c Modules/config.c.in 
Modules/imageop.c Modules/imgfile.c Objects/floatobject.c Objects/intobject.c 
Objects/listobj
description:
* Extended X interface: pixmap objects, colormap objects visual objects,
  image objects, and lots of new methods.
* Added counting of allocations and deallocations of builtin types if
  COUNT_ALLOCS is defined.  Had to move calls to NEWREF down in some
  files.
* Bug fix in sorting lists.

--

___
Python tracker 

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



[issue25776] More compact pickle of iterators etc

2015-12-02 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch makes a number of classes produce more compact pickle data in 
common case. This includes iterators of list, tuple, str, bytes, bytearray, 
enumerate, array, deque, iterator object for classes with __getitem__, some 
itertools iterators, and non-iterator objects: slice, bytearray, deque. This is 
achieved by omitting default constructor arguments or state.

Exhausted iterators are pickled as iter(()). This is not new, exhausted bytes, 
and bytearray iterators, and reversed list iterator are already pickled as 
iter('') or iter([]) correspondingly. iter(()) is just the simplest way to 
create an empty iterator and it has the most compact pickle representation.

An example.

Unpatched:
>>> import pickle, pickletools, itertools
>>> len(pickle.dumps(itertools.islice('abcdefgh', 4), 3))
80
>>> len(pickletools.optimize(pickle.dumps(itertools.islice('abcdefgh', 4), 3)))
66
>>> pickletools.dis(pickletools.optimize(pickle.dumps(itertools.islice('abcdefgh',
>>>  4), 3)))
0: \x80 PROTO  3
2: cGLOBAL 'itertools islice'
   20: (MARK
   21: cGLOBAL 'builtins iter'
   36: XBINUNICODE 'abcdefgh'
   49: \x85 TUPLE1
   50: RREDUCE
   51: KBININT10
   53: bBUILD
   54: KBININT10
   56: KBININT14
   58: KBININT11
   60: tTUPLE  (MARK at 20)
   61: RREDUCE
   62: KBININT10
   64: bBUILD
   65: .STOP
highest protocol among opcodes = 2

Patched:
>>> len(pickle.dumps(itertools.islice('abcdefgh', 4), 3))
69
>>> len(pickletools.optimize(pickle.dumps(itertools.islice('abcdefgh', 4), 3)))
55
>>> pickletools.dis(pickletools.optimize(pickle.dumps(itertools.islice('abcdefgh',
>>>  4), 3)))
0: \x80 PROTO  3
2: cGLOBAL 'itertools islice'
   20: cGLOBAL 'builtins iter'
   35: XBINUNICODE 'abcdefgh'
   48: \x85 TUPLE1
   49: RREDUCE
   50: KBININT14
   52: \x86 TUPLE2
   53: RREDUCE
   54: .STOP
highest protocol among opcodes = 2

--
components: Extension Modules, Interpreter Core
files: iterators_pickle.diff
keywords: patch
messages: 255699
nosy: alexandre.vassalotti, pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: More compact pickle of iterators etc
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41207/iterators_pickle.diff

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2015-12-02 Thread STINNER Victor

STINNER Victor added the comment:

00141-fix-tests_with_COUNT_ALLOCS-v5.patch: please don't do that! It makes 
tests much more verbose for a compilation option which is hidden and probably 
almost never used in the wild. The option has no configuration option for 
example.

*If* you really want to keep the feature, I would prefer to make it more 
visible (add a configuration option) and disable the output at exit by default. 
It's better to add a new "-X showcountallocs" as it was done with "-X 
showrefcount". Before, we had to fix a lot of unit tests (as 
00141-fix-tests_with_COUNT_ALLOCS-v5.patch) to strip the "[xxx refs]" from 
stderr, it was very annoying.

"Python 3.4 now has sys.getallocatedblocks() and a new tracemalloc module which 
are compiled by default."

IMHO these two debug features superseded COUNT_ALLOCS. Please try to convince 
me of the use case of this very old debug feature.

--

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2015-12-02 Thread Robert Kuska

Robert Kuska added the comment:

FYI There is also issue23034 where is proposed "-X showalloccount" option to 
suppress the output, we use (custom patch) environment variable to filter out 
the verbose output in Fedora.

--

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, I also don't want to use 00141-fix-tests_with_COUNT_ALLOCS-v5.patch if 
there is better alternative. See issue23034 (I'm uncertain only in option name).

--

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2015-12-02 Thread Bohuslav "Slavek" Kabrda

Bohuslav "Slavek" Kabrda added the comment:

> IMHO these two debug features superseded COUNT_ALLOCS. Please try to convince 
> me of the use case of this very old debug feature.

I no longer use this feature and I think that noone does. As you said, it seems 
to be obsoleted by other new features, so my vote would be to remove 
COUNT_ALLOCS altogether.

--

___
Python tracker 

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



[issue22039] PyObject_SetAttr doesn't mention value = NULL

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See two alternative issues: issue25701 for documenting existing behavior, and 
issue25773 for deprecating it (and converting PyObject_DelAttr to a function).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-02 Thread Larry Hastings

Larry Hastings added the comment:

Is this going in soon?  I want to cherry-pick this for 3.5.1, which I tag in 
about 80 hours.

--

___
Python tracker 

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



[issue25715] Python 3.5.1 installer shows wrong upgrade path

2015-12-02 Thread Larry Hastings

Larry Hastings added the comment:

You can have it in 3.5.1, and we can negotiate about how to get it in.

--

___
Python tracker 

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



[issue14285] Traceback wrong on ImportError while executing a package

2015-12-02 Thread Martin Panter

Martin Panter added the comment:

Thanks for the review Nick. You removed Python 3.4 from the versions; do you 
think it is not worth the risk committing in 3.4? I understand the deadline for 
the final release of 3.4 is the end of this week.

--

___
Python tracker 

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



[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I wait only Greg's approving for 3.3. If I'll not get it in a day, I'll commit 
the patch for 3.4+.

--

___
Python tracker 

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



[issue25756] asyncio WriteTransport documentation typo

2015-12-02 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I think the doc is correct.
`pause_writing` is called when write buffer becomes non empty, empty buffer is 
precondition for `resume_writing` call.

--
nosy: +asvetlov
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions:  -Python 3.2, Python 3.3

___
Python tracker 

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



[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-02 Thread STINNER Victor

STINNER Victor added the comment:

Please commit right now to 3.4+. Backport to 3.3 can be done later.

--

___
Python tracker 

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



[issue19527] Test failures with COUNT_ALLOCS

2015-12-02 Thread STINNER Victor

STINNER Victor added the comment:

I propose to emit a compiler warning (or even an error?) in 3.5.x and drop
the code in 3.6. I don't think that a long deprecation period is requied.
The feature is not widely used.

--

___
Python tracker 

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



[issue25777] Misleading descriptions in docs about invoking descriptors.

2015-12-02 Thread Juchen Zeng

New submission from Juchen Zeng:

[Doc Link](https://docs.python.org/2/howto/descriptor.html#invoking-descriptors)

In descriptions about how to invoke descriptors with super(), it says:

The call super(B, obj).m() searches obj.__class__.__mro__ for the base 
class A immediately following B and then returns A.__dict__['m'].__get__(obj, 
B). If not a descriptor, m is returned unchanged. If not in the dictionary, m 
reverts to a search using object.__getattribute__().

But the call ` super(B, obj).m()` will not return `A.__dict__['m'].__get__(obj, 
B)`, it will trigger the `__call__` method of ` A.__dict__['m'].__get__(obj, 
B)` if it has that attr, and return what this `__call__` method returns.  It 
could be anything.
It's actually `super(B, obj).m` returns `A.__dict__['m'].__get__(obj, B)` if m 
is a descriptor.

In short, the original description in the doc can be abbreviated to:
`The call super(B, obj).m() [did something] and returns 
A.__dict__['m'].__get__(obj, B).`
Which is obviously misleading.

As the method/function call isn't the core part in this sentence. I suggest the 
doc to be fixed like this:

The action super(B, obj).m searches obj.__class__.__mro__ for the base 
class A immediately following B and then returns A.__dict__['m'].__get__(obj, 
B).

--
assignee: docs@python
components: Documentation
messages: 255712
nosy: Juchen Zeng, docs@python, martin.panter
priority: normal
severity: normal
status: open
title: Misleading descriptions in docs about invoking descriptors.
versions: Python 2.7

___
Python tracker 

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



[issue16251] pickle special methods are looked up on the instance rather than the type

2015-12-02 Thread Rob Agar

Changes by Rob Agar :


--
nosy: +robagar

___
Python tracker 

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



[issue25719] Deprecate spitfire benchmark

2015-12-02 Thread Florin Papa

Florin Papa added the comment:

No problem. Thank you!

--

___
Python tracker 

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



[issue25177] OverflowError in statistics.mean when summing large floats

2015-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a7d2307055e7 by Victor Stinner in branch 'default':
Null merge 3.5, patch was already applied to default (isuse #25177)
https://hg.python.org/cpython/rev/a7d2307055e7

--

___
Python tracker 

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



[issue25778] Error on import matplotlib.pyplot and seaborn (Python3 - Windows 10 64-bit issue)

2015-12-02 Thread Anshul Agrawal

New submission from Anshul Agrawal:

I have described the error message I got when I recently installed Python 3.5.0 
(via Anaconda3) and then subsequently tried to import mathplotlib.pyplot and 
seaborn packages at this StackOverflow post 
(http://stackoverflow.com/questions/34004063/error-on-import-matplotlib-pyplot-on-anaconda3-for-windows-10-home-64-bit-pc)

Another person responded to the above post with a simple 1-line patch to the 
file "fontList.py3k.cache" (please see the above post for details).

This does appear to be a purely Python 3 issue on some Windows platforms. It 
would be nice if Python 3 developers could check the patch out for any possible 
side-effects, and incorporate a permanent fix in future versions.  Thanks.

--
components: Extension Modules
messages: 255715
nosy: anshul6
priority: normal
severity: normal
status: open
title: Error on import matplotlib.pyplot and seaborn (Python3 - Windows 10 
64-bit issue)
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue14285] Traceback wrong on ImportError while executing a package

2015-12-02 Thread Nick Coghlan

Nick Coghlan added the comment:

Right, while I agree this is a bug fix that makes sense to apply to 2.7 and 
3.5, it's also a large enough change to runpy's control flow logic that I'm 
wary of including it in the final 3.4 binary release.

--

___
Python tracker 

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



[issue25778] Error on import matplotlib.pyplot and seaborn (Python3 - Windows 10 64-bit issue)

2015-12-02 Thread SilentGhost

Changes by SilentGhost :


--
components: +Library (Lib)
nosy: +stutzbach
stage:  -> test needed

___
Python tracker 

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



[issue25778] Error on import matplotlib.pyplot and seaborn (Python3 - Windows 10 64-bit issue)

2015-12-02 Thread SilentGhost

Changes by SilentGhost :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue25778] Error on import matplotlib.pyplot and seaborn (Python3 - Windows 10 64-bit issue)

2015-12-02 Thread R. David Murray

R. David Murray added the comment:

The stackoverflow comment is this:

"The issue is that winreg.EnumValue is not cutting string values at their 
length properly for some reason, and strings will include null characters which 
os.path.abspath is not able to process."

The "one line patch" in the stackoverflow comment is against matplotlib, not 
python, so it doesn't help toward fixing this.

What would be most useful toward fixing this is a reproducer, but since that 
will depend on data in the registry whoever creates the reproducer may as well 
do it as a unit test.

I'm adding 2.7 to versions since it seems unlikely the code is different there, 
but I haven't checked.  Anshul, if you have tested this on python2.7 and not 
seen the problem there, please update the issue with that info.

--
keywords: +easy
nosy: +r.david.murray
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread R. David Murray

Changes by R. David Murray :


--
title: Error on import matplotlib.pyplot and seaborn (Python3 - Windows 10 
64-bit issue) -> winreg.EnumValue does not truncate strings correctly

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Anshul Agrawal

Anshul Agrawal added the comment:

Before I got the "one line patch" on stackoverflow, I tried creating a new 
environment with Python 2.7.10 and did *not* get the error message I got with 
Python 3.5.0.  Here's an outline of what I did:

1) Created a new environment to use Python 2.7.10: conda create --name 
python2.7.10 python=2.7.10
2) Installed matplotlib package within it: conda install --name python2.7.10 
matplotlib
3) Installed seaborn package within it: conda install --name python2.7.10 
seaborn

When I started Python within this environment (verified it was version 2.7.10 
with "print(sys.version)"), and did "import matplotlib.pyplot" and "import 
seaborn", the FileNotFoundError message did not appear.  So the problem appears 
to be associated with Python3, not Python2.

Hope this helps.

--

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Jack O'Connor

New submission from Jack O'Connor:

The following hangs at 100% CPU on Python 3.5, though not on Python 3.4:

1) Start an asyncio coroutine with run_until_complete().
2) Inside the coroutine, enter an ExitStack using a with-statement.
3) Inside the with-statement, call ExitStack.enter_context() with a generator 
context manager. It doesn't matter what the generator yields.
4) After the enter_context() call, raise an exception.

Here's an example script that does all of this and repros the hang: 
https://gist.github.com/oconnor663/483db2820bb5f877c9ed

--
components: asyncio
messages: 255719
nosy: gvanrossum, haypo, oconnor663, yselivanov
priority: normal
severity: normal
status: open
title: deadlock with asyncio+contextmanager+ExitStack
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Eryk Sun

Eryk Sun added the comment:

Based on matplotlib's win32InstalledFonts function [1], I created a small test 
to check the data strings returned by winreg.EnumValue for the presence of null 
characters. I tested on Windows 7 and 10 but couldn't reproduce the problem. 
Please run nullcheck.py to check the results on your system.

[1]: 
https://github.com/matplotlib/matplotlib/blob/v1.5.0/lib/matplotlib/font_manager.py#L200

--
nosy: +eryksun
Added file: http://bugs.python.org/file41208/nullcheck.py

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Guido van Rossum

Guido van Rossum added the comment:

Interestingly, it doesn't hang when you raise a different error. There's some 
new code dealing with the RuntimeError coming out of a generator if it raises 
StopIteration (instead of returning) introduced by issue #22906. Yury, it looks 
like you introduced that? (The diff is this:

changeset:   95932:36a8d935c322
user:Yury Selivanov 
date:Sat May 09 11:44:30 2015 -0400
summary: PEP 479: Change StopIteration handling inside generators.

--
assignee:  -> yselivanov
keywords: +3.5regression

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Trying to reproduce without contextstack.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2015-12-02 Thread Jason R. Coombs

Changes by Jason R. Coombs :


--
stage:  -> needs patch
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue25780] Add support for CAN_RAW_JOIN_FILTERS

2015-12-02 Thread Stefan Tatschner

New submission from Stefan Tatschner:

Here is a patch, which adds support for CAN_RAW_JOIN_FILTERS which is available 
since linux 4.1 [1]. My patch fixes trailing whitespace issues as well. Since I 
have a newer version of autotools, running "autoreconf" generates a lot of 
changes, so I left that out for the time being.

[1]: 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a5581ef4c2eac6449188862e903eb46c7233582a

--
components: Library (Lib)
files: can_raw_join_filters.diff
keywords: patch
messages: 255723
nosy: rumpelsepp
priority: normal
severity: normal
status: open
title: Add support for CAN_RAW_JOIN_FILTERS
versions: Python 3.6
Added file: http://bugs.python.org/file41210/can_raw_join_filters.diff

___
Python tracker 

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



[issue25780] Add support for CAN_RAW_JOIN_FILTERS

2015-12-02 Thread Stefan Tatschner

Stefan Tatschner added the comment:

in case you don't like whitespace cleanups, here is the patch with "git diff 
--ignore-space-changes".

--
Added file: 
http://bugs.python.org/file41211/can_raw_join_filters-no-whitespace.diff

___
Python tracker 

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



[issue25770] expose name, args, and kwargs from methodcaller

2015-12-02 Thread Joe Jevnik

Joe Jevnik added the comment:

partial's unique usage is why I feel like it would be so jarring for them do be 
named differently. I would be happiest having this feature at all so I will 
change the name to 'kwargs' if you would like. I just want to be sure that my 
reasons for choosing this name in the first place ere understood.

--

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Here's a minimal test to reproduce:

import reprlib


def main():
if 0:
yield
raise RuntimeError


m = main()
try:
m.send(None)
except RuntimeError as ex:
ex.__context__ = ex
reprlib.repr(ex)


Looks like it's a bug in reprlib.  It's not related to PEP 492/479.  

It's also reproducible in Python 3.4 and 3.3.

Nick, ExitStack does this (indirectly) 'ex.__context__ = ex' thing -- I think 
that's a bug of contextlib.

--

___
Python tracker 

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



[issue25781] infinite loop in reprlib

2015-12-02 Thread Yury Selivanov

New submission from Yury Selivanov:

The below code blocks Python eval loop and makes it unresponsive to signals 
(like ^C).

import reprlib

try:
raise RuntimeError
except RuntimeError as ex:
ex.__context__ = ex
reprlib.repr(ex)

--
components: Library (Lib)
messages: 255727
nosy: yselivanov
priority: normal
severity: normal
status: open
title: infinite loop in reprlib
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Created another issue for the reprlib bug: issue 25781.  It appears we don't 
even need a generator:

import reprlib

try:
raise RuntimeError
except RuntimeError as ex:
ex.__context__ = ex
reprlib.repr(ex)

Closing this one with "not a bug".

--
resolution:  -> not a bug
status: open -> closed
superseder:  -> infinite loop in reprlib

___
Python tracker 

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



[issue25781] infinite loop in reprlib

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

This isn't a bug of reprlib -- it's something in the core. Will create a 
separate issue for this.

try:
raise Exception
except Exception as ex:
ex.__context__ = ex
hasattr(1, 'aa')

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

It's not even a reprlib bug:

try:
raise Exception
except Exception as ex:
ex.__context__ = ex
hasattr(1, 'aa')

--

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Changes by Yury Selivanov :


--
superseder: infinite loop in reprlib -> CPython hangs on error __context__ set 
to the error itself

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

New submission from Yury Selivanov:

try:
raise Exception
except Exception as ex:
ex.__context__ = ex
hasattr(1, 'aa')

--
components: Interpreter Core
messages: 255731
nosy: gvanrossum, haypo, ncoghlan, yselivanov
priority: normal
severity: normal
status: open
title: CPython hangs on error __context__ set to the error itself
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Jack O'Connor

Jack O'Connor added the comment:

Thanks for chasing this down. Yury, can you suggest a workaround?

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy: +georg.brandl, larry
priority: normal -> release blocker

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> Thanks for chasing this down. Yury, can you suggest a workaround?

I'm not sure how to workaround this :(  Hopefully we can fix this in 3.5.1.

--

___
Python tracker 

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



[issue25715] Python 3.5.1 installer shows wrong upgrade path

2015-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8537ec50c254 by Steve Dower in branch '3.5':
Issue #25715: Python 3.5.1 installer shows wrong upgrade path and incorrect 
logic for launcher detection.
https://hg.python.org/cpython/rev/8537ec50c254

--
nosy: +python-dev

___
Python tracker 

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



[issue25715] Python 3.5.1 installer shows wrong upgrade path

2015-12-02 Thread Steve Dower

Steve Dower added the comment:

As you can see, I've now pushed to the main 3.5 branch, so feel free to 
cherry-pick from there or give me the word and I'll graft it into the releasing 
repo for you.

I also forward merged all the 3.5.1 NEWS into default. Not sure how that 
normally happens, but it was easier to do it with a big copy-past than try and 
figure out the merge conflicts...

--

___
Python tracker 

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



[issue25781] infinite loop in reprlib

2015-12-02 Thread Jack O'Connor

Changes by Jack O'Connor :


--
nosy: +oconnor663

___
Python tracker 

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



[issue25780] Add support for CAN_RAW_JOIN_FILTERS

2015-12-02 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +pitrou

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Anshul Agrawal

Anshul Agrawal added the comment:

Please tell me where I can find nullcheck.py and how I should run it (I assume 
something like "python nullcheck.py" in the Windows Command Prompt?)  I'm 
relatively new to Python, so explicit instructions would be appreciated.  
Thanks!

--

___
Python tracker 

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



[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2015-12-02 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +easy

___
Python tracker 

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



[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2015-12-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +matrixise

___
Python tracker 

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



[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2015-12-02 Thread STINNER Victor

New submission from STINNER Victor:

Tested on Python 3.6 (default branch):

haypo@smithers$ ./python -m test test_traceback
[1/1] test_traceback
1 test OK.

haypo@smithers$ ./python Lib/test/test_traceback.py 
..F...
==
FAIL: test_walk_stack (__main__.TestStack)
--
Traceback (most recent call last):
  File "Lib/test/test_traceback.py", line 684, in test_walk_stack
self.assertGreater(len(s), 10)
AssertionError: 10 not greater than 10

--
Ran 58 tests in 2.184s

FAILED (failures=1)

--
components: Tests
messages: 255737
nosy: haypo
priority: normal
severity: normal
status: open
title: test_traceback.test_walk_stack() fails when run directly (without 
regrtest)
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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread SilentGhost

SilentGhost added the comment:

Anshul, it's attached to this issue, before messages start under Files heading. 
Here is the direct link https://bugs.python.org/file41208/nullcheck.py

--
nosy: +SilentGhost

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

The bug is in "PyErr_SetObject":

while ((context = PyException_GetContext(o))) {
Py_DECREF(context);
if (context == value) {
PyException_SetContext(o, NULL);
break;
}
o = context;
}

The loop can be infinite.

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Looks like this is the original code committed in CPython in 2ee09afee126.  
Patch by Antoine Pitrou.

Antoine, how would you fix this?

--
nosy: +pitrou

___
Python tracker 

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



[issue25784] Please consider integrating performance fix for ipaddress.py

2015-12-02 Thread Alexander Finkel

New submission from Alexander Finkel:

I encountered a performance problem using the ipaddr library to merge over 
1 network addresses. I sent a patch upstream to fix it, and that patch has 
been merged:
https://github.com/google/ipaddr-py/commit/6504b47a02739e853043f0a184f3c39462293e5c

Since ipaddr is also included in the standard lib of Python 3 (I think since 
version 3.3?) and above, I'd like to ask that this patch be considered for 
committing here too.

Background on including ipaddr into the std lib: 
https://bugs.python.org/issue14814

--
messages: 255741
nosy: Alexander Finkel
priority: normal
severity: normal
status: open
title: Please consider integrating performance fix for ipaddress.py

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Eryk Sun

Eryk Sun added the comment:

You should be able to run nullcheck.py in the command prompt by changing to the 
directory where it's saved and entering nullcheck.py. For example, if you saved 
it in your Downloads folder:

>cd /d C:\Users\Anshul\Downloads
>nullcheck.py

If that fails because the .py file association isn't set up properly, instead 
try

>py nullcheck.py

--

___
Python tracker 

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



[issue25784] Please consider integrating performance fix for ipaddress.py

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you provide a patch?

--
components: +Library (Lib)
nosy: +ncoghlan, pmoody, serhiy.storchaka
type:  -> performance
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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I would change __context__ setter to check if it creates a loop.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Anshul Agrawal

Anshul Agrawal added the comment:

Ok thanks.  Here's what I got:

C:\Users\Anshul\Downloads\Python>conda info --envs
# conda environments:
#
python2.7.10 C:\Anaconda3\envs\python2.7.10
root  *  C:\Anaconda3


C:\Users\Anshul\Downloads\Python>python -V
Python 3.5.0 :: Anaconda 2.4.0 (64-bit)

C:\Users\Anshul\Downloads\Python>python nullcheck.py
Checking: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
('tahoma.ttf\x000\x000\x00\x00\x00', 1) Tahoma (TrueType)
('verdref.ttf\x000\x000\x00PA\x00\x00\x00\x00', 1) Verdana Ref (TrueType)
('grgaref.ttf\x000\x000\x00PA\x00\x00\x00\x00', 1) Georgia Ref (TrueType)
('refspec.ttf\x000\x000\x00PA\x10\x00%APP', 1) RefSpecialty (TrueType)
Cannot open: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts
done

C:\Users\Anshul\Downloads\Python>activate python2.7.10
Activating environment "C:\Anaconda3\envs\python2.7.10"...

[python2.7] C:\Users\Anshul\Downloads\Python>python -V
Python 2.7.10 :: Continuum Analytics, Inc.

[python2.7] C:\Users\Anshul\Downloads\Python>python nullcheck.py
Traceback (most recent call last):
  File "nullcheck.py", line 3, in 
import winreg
ImportError: No module named winreg

[python2.7] C:\Users\Anshul\Downloads\Python>

--

___
Python tracker 

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



[issue24934] django_v2 benchmark not working in Python 3.6

2015-12-02 Thread Brett Cannon

Brett Cannon added the comment:

Django 1.9 is out, so when I have time I will create a django_v3 benchmark.

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Serhiy, good idea, thanks!  Please review the attached patch.

Larry, I view this as a very serious bug.  Can we ship 3.5.1 with it fixed?

--
keywords: +patch
Added file: http://bugs.python.org/file41212/Issue25782.patch

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

FWIW the bug was identified in issue 25782.  I've drafted a patch to fix it, 
please review.

--

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

The question is whether we should raise an exception or not:

   ex.__context__ = ex

--

___
Python tracker 

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



[issue25784] Please consider integrating performance fix for ipaddress.py

2015-12-02 Thread SilentGhost

SilentGhost added the comment:

Perhaps I'm wrong, but a superficial inspection of the ipaddress.py seem to 
indicate that it's not affected by the same issue. _find_address_range is 
implemented as a generator, it doesn't restart comparison on every iteration. 
Alexander, did you experience any performance issues when using ipaddress 
module from standard library?

--
nosy: +SilentGhost

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Eryk Sun

Eryk Sun added the comment:

I only wrote it for Python 3, but it would be interesting to see what you get 
with Python 2. Please try nullcheck2.py.

--
Added file: http://bugs.python.org/file41213/nullcheck2.py

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Jack O'Connor

Jack O'Connor added the comment:

Yury, do we need to handle more complicated infinite loops, where "self" 
doesn't actually show up in the loop? Here's an example:

try:
raise Exception
except Exception as ex:
loop1 = Exception()
loop2 = Exception()
loop1.__context__ = loop2
loop2.__context__ = loop1
ex.__context__ = loop1
hasattr(1, 'aa')

I'm unfamiliar with CPython, so I don't know whether full-blown loop detection 
belongs here. Maybe we could add a hardcoded limit like "fail if we loop more 
than X times"?

--
nosy: +oconnor663

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> Yury, do we need to handle more complicated infinite loops, where "self" 
> doesn't actually show up in the loop? Here's an example:

My patch works for your example too.  Since it checks for loops in __context__ 
setter, you shouldn't be able to create complicated loops.

--

___
Python tracker 

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



[issue25778] winreg.EnumValue does not truncate strings correctly

2015-12-02 Thread Anshul Agrawal

Anshul Agrawal added the comment:

Here it is:

[python2.7] C:\Users\Anshul\Downloads\Python>python -V
Python 2.7.10 :: Continuum Analytics, Inc.

[python2.7] C:\Users\Anshul\Downloads\Python>python nullcheck2.py
Checking: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
(u'tahoma.ttf\x000\x000\x00\x00\x00', 1), Tahoma (TrueType)
(u'verdref.ttf\x000\x000\x00PA\x00\x00\x00\x00', 1), Verdana Ref (TrueType)
(u'grgaref.ttf\x000\x000\x00PA\x00\x00\x00\x00', 1), Georgia Ref (TrueType)
(u'refspec.ttf\x000\x000\x00PA\x10\x00%APP', 1), RefSpecialty (TrueType)
Cannot open: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts
done

[python2.7] C:\Users\Anshul\Downloads\Python>activate
Deactivating environment "C:\Anaconda3\envs\python2.7.10"...
Activating environment "C:\Anaconda3\Scripts\..\"...

C:\Users\Anshul\Downloads\Python>python -V
Python 3.5.0 :: Anaconda 2.4.0 (64-bit)

C:\Users\Anshul\Downloads\Python>python nullcheck2.py
Checking: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
('tahoma.ttf\x000\x000\x00\x00\x00', 1), Tahoma (TrueType)
('verdref.ttf\x000\x000\x00PA\x00\x00\x00\x00', 1), Verdana Ref (TrueType)
('grgaref.ttf\x000\x000\x00PA\x00\x00\x00\x00', 1), Georgia Ref (TrueType)
('refspec.ttf\x000\x000\x00PA\x10\x00%APP', 1), RefSpecialty (TrueType)
Cannot open: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts
done

C:\Users\Anshul\Downloads\Python>

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Should we do the same for __cause__? Is it possible to create __context__ or 
__cause__ loop without assigning these attributes directly?

--

___
Python tracker 

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



[issue6395] Infinite Recursion during Unpickling a codecs Object

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> If the StreamWriter/Reader cannot pickle the underlying stream (which is
probably always the case), why should the object itself be pickleable ?

io.BytesIO() and io.StringIO() are pickleable.

--

___
Python tracker 

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



[issue25785] TimedRotatingFileHandler missing rotations

2015-12-02 Thread Felipe Cruz

New submission from Felipe Cruz:

I'm using TimedRotatingFileHandler to rotate a log file *every* minute.

If I stop my program, in the middle of a minute, and start again, the next 
rotation will happen at (currentTime + 60). The result of this behavior is that 
I'll end up with files "log_01" and "log_03", instead of "log_01", "log_02" and 
"log_03".

I'm using this class with a little modification which sets the next rollover 
time to (currentTime + (self.interval - currentSecond)). In this case, even If 
I stop and start my program in the middle a minute, the next rollover time will 
be the end of the current minute, not 60 seconds later and the result will be 
one file for each minute.

To sum up, what happen is that the same program with the very same 
configuration, produces a different result if stopped for even just one second. 
If the interval was "rotate every 60 seconds" I would be ok, but If I'm 
configuring to rotate every minute I expect one file for each minute if the 
program was running the time the minutes changed.

--
messages: 255757
nosy: felipecruz
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler missing rotations
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue25785] TimedRotatingFileHandler missing rotations

2015-12-02 Thread SilentGhost

Changes by SilentGhost :


--
components: +Library (Lib)
nosy: +vinay.sajip
type: behavior -> enhancement

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> Should we do the same for __cause__? Is it possible to create __context__ or 
> __cause__ loop without assigning these attributes directly?

Yes, let's mirror the __context__ behaviour for __cause__.  New patch attached.


Serhiy, Guido,

The new patch raises a TypeError in __cause__ and __context__ setters when a 
cycle was introduced, so in pure Python the following won't work:


   # will throw TypeError("cycle in exception context chain")
   ex.__context__ = ex chain")

   # will throw TypeError("cycle in exception cause chain")
   ex.__cause__ = ex


However, since PyException_SetContext and PyException_SetCause are public APIs, 
and their return type is 'void', I can't raise an error when a C code 
introduces a cycle, in that case, the exc->cause/exc->context will be set to 
NULL.

Thoughts?

I think that this approach is the only sane one here.  We can certainly fix the 
infinite loop in PyErr_SetObject, but it will only be a matter of time until we 
discover a similar loop somewhere else.

--
Added file: http://bugs.python.org/file41214/Issue25782_2.patch

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Guido van Rossum

Guido van Rossum added the comment:

Ouch, it's unfortunate those APIs don't have an error return. :-(

Setting it to NULL is one option -- silently ignoring the assignment
(leaving whatever was there) might also be good? In 90% of the cases it
would be the same thing right? (I'm not familiar with this part of the code
TBH.)

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> Setting it to NULL is one option -- silently ignoring the assignment
(leaving whatever was there) might also be good? In 90% of the cases it
would be the same thing right? 

But leaving the old __context__ there will completely mask the bug...

And as for pure python code -- do you agree we better raise a TypeError if a 
cycle is about to be introduced?

--

___
Python tracker 

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



[issue6395] Infinite Recursion during Unpickling a codecs Object

2015-12-02 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 02.12.2015 20:16, Serhiy Storchaka wrote:
> 
> Serhiy Storchaka added the comment:
> 
>> If the StreamWriter/Reader cannot pickle the underlying stream (which is
>> probably always the case), why should the object itself be pickleable ?
> 
> io.BytesIO() and io.StringIO() are pickleable.

Ok, but I still don't see the use case :-)

I think all we need to do is add a .__reduce__()
method to StreamWriter and StreamReader, which then
raises a PickleError.

Example:

>>> import sys, codecs, pickle
>>> r = codecs.getreader('latin-1')
>>> class MyReader(r):
...def __reduce__(self, *args):
...   raise pickle.PickleError
...
>>> s = MyReader(sys.stdin)
>>> pickle.dumps(s)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __reduce__
_pickle.PickleError
> (3)__reduce__()

--

___
Python tracker 

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



[issue25786] contextlib.ExitStack introduces a cycle in exception __context__

2015-12-02 Thread Yury Selivanov

New submission from Yury Selivanov:

See http://bugs.python.org/issue25779 and http://bugs.python.org/issue25782 for 
details.

--
components: Library (Lib)
messages: 255762
nosy: gvanrossum, ncoghlan, serhiy.storchaka, yselivanov
priority: release blocker
severity: normal
status: open
title: contextlib.ExitStack introduces a cycle in exception __context__
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue6395] Infinite Recursion during Unpickling a codecs Object

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added tests for pickling and deepcopying.

--
Added file: http://bugs.python.org/file41215/codecs_stream_delegating_2.patch

___
Python tracker 

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



[issue25786] contextlib.ExitStack introduces a cycle in exception __context__

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Nick, could you please take a look at the attached patch?

--
keywords: +patch
Added file: http://bugs.python.org/file41216/Issue25786.patch

___
Python tracker 

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



[issue1927] raw_input behavior incorrect if readline not enabled

2015-12-02 Thread Jason R. Coombs

Changes by Jason R. Coombs :


--
nosy: +jason.coombs

___
Python tracker 

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



[issue1927] raw_input behavior incorrect if readline not enabled

2015-12-02 Thread Jason R. Coombs

Changes by Jason R. Coombs :


--
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Another issue for contextlib: http://bugs.python.org/issue25786

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Guido van Rossum

Guido van Rossum added the comment:

> But leaving the old __context__ there will completely mask the bug...
OK, NULL is fine then.

>we better raise a TypeError if a cycle is about to be introduced?
Yes.

--

___
Python tracker 

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



[issue25786] contextlib.ExitStack introduces a cycle in exception __context__

2015-12-02 Thread Jack O'Connor

Changes by Jack O'Connor :


--
nosy: +oconnor663

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yet one option is the emersion of the exception. Affected exception is removed 
from the chain and added at it head.

If there is a chain A -> B -> C -> D -> E, after assignment C.__context__ = A 
we will get a chain C -> A -> B -> D -> E. No exception is lost.

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread STINNER Victor

STINNER Victor added the comment:

> Larry, I view this as a very serious bug.  Can we ship 3.5.1 with it fixed?

Don't do that, a few hours (!) is not enough to test a fix. It's too
late after a RC1 for such critical change (exceptions).

The bug was here since at least Python 3.3, there is no urgency to fix it.

--

___
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

2015-12-02 Thread desbma

desbma added the comment:

Ping

A small patch, but a good performance improvement :)

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

>Don't do that, a few hours (!) is not enough to test a fix. It's too
late after a RC1 for such critical change (exceptions).

Maybe we can add an RC2?

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> If there is a chain A -> B -> C -> D -> E, after assignment C.__context__ = A 
> we will get a chain C -> A -> B -> D -> E. No exception is lost.

What to do when you try to chain "C -> C"?  

I'm not sure I like this reordering idea -- it might introduce some *very* hard 
to find bugs -- you expected one type of exception, then you used some external 
library, and after that you have a completely different exception.

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread STINNER Victor

STINNER Victor added the comment:

> Maybe we can add an RC2?

Seriously? I'm waiting Python 3.5.1 since 3.5.0 was released. I'm amazed how 
much time it takes to release a first bugfix version, 3.5.0 was full a bugs 
(see the changelog).

It's very easy to workaround this issue in pure Python. Why do you want the fix 
*RIGHT NOW*?

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> It's very easy to workaround this issue in pure Python. Why do you want the 
> fix *RIGHT NOW*?

Please look at http://bugs.python.org/issue25779.  I think we either should fix 
this issue, or fix http://bugs.python.org/issue25786 in 3.5.1, since I can't 
find a workaround for it.  The latter issue is probably easier to get into 
3.5.1?

--

___
Python tracker 

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



[issue6395] Infinite Recursion during Unpickling a codecs Object

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I think all we need to do is add a .__reduce__()
> method to StreamWriter and StreamReader, which then
> raises a PickleError.

Rather TypeError. Yes, it is the least that we should to do in maintained 
releases. If codecs_stream_delegating_2.patch is considered too drastic for 
bugfix. But this can be only a part of problem. May be there are issues with 
other optional special methods. And adding __reduce_ex__ breaks subclass 
pickleability if it was implemented with __getstate__ and __getnewargs__.

Here is a patch for this way.

--
Added file: http://bugs.python.org/file41217/codecs_stream_forbid_pickling.patch

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread STINNER Victor

STINNER Victor added the comment:

Yury Selivanov added the comment:
> Please look at http://bugs.python.org/issue25779.  I think we either should 
> fix this issue, or fix http://bugs.python.org/issue25786 in 3.5.1, since I 
> can't find a workaround for it.  The latter issue is probably easier to get 
> into 3.5.1?

It's a choice for the release manager. But IHMO there will always be
bugs :-) It looks like you found a lot of issues related to exceptions
handling. Maybe it would be better to fix all the them "at once" in
3.5.2? And then ask Larry to release it early?

--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2015-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> What to do when you try to chain "C -> C"?

Nothing. Or may be raise an exception (because C.__context__ can't be set to 
what you try).

> you expected one type of exception, then you used some external library, and 
> after that you have a completely different exception.

I don't understand what new can add the reordering. It doesn't change original 
exception, it only changes __context__, but you change it in any case. If 
silently ignore the loop, you would get __context__ different from what you 
expected. If raise TypeError, you would get TypeError instead of expected 
exception.

And if the decision will be to raise TypeError, may be RuntimeError is more 
appropriate?

--

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> Yury, can you help me understand why `hasattr("foo", "bar")` triggers the 
> infinite loop there, but not `print("foo")`?


hasattr uses getattr under the hood. getattr raises an AttributeError, and that 
triggers PyErr_SetError, which has an infinite "while" loop.  Instead of 
"hasattr" you can use anything that raises an error.

--

___
Python tracker 

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



[issue25779] deadlock with asyncio+contextmanager+ExitStack

2015-12-02 Thread Jack O'Connor

Jack O'Connor added the comment:

Yury, can you help me understand why `hasattr("foo", "bar")` triggers the 
infinite loop there, but not `print("foo")`?

--

___
Python tracker 

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



[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2015-12-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +rbcollins

___
Python tracker 

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



[issue1927] raw_input behavior incorrect if readline not enabled

2015-12-02 Thread Jason R. Coombs

Jason R. Coombs added the comment:

+1 to applying this patch. After reviewing this and Issue 12869, I don't see 
any substantial objections or concerns. The status is "test needed". Is a test 
really needed? My instinct that simply aligning the implementation with the 
docs is sufficient.

--

___
Python tracker 

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



  1   2   >