[issue25447] TypeError invoking deepcopy on lru_cache

2015-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your report and review Jason.

--
resolution:  -> fixed
stage: patch review -> 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



[issue25447] TypeError invoking deepcopy on lru_cache

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 73226f0d0f89 by Serhiy Storchaka in branch '3.5':
Issue #25447: The lru_cache() wrapper objects now can be copied and pickled
https://hg.python.org/cpython/rev/73226f0d0f89

New changeset d3e048c7b65a by Serhiy Storchaka in branch 'default':
Issue #25447: The lru_cache() wrapper objects now can be copied and pickled
https://hg.python.org/cpython/rev/d3e048c7b65a

--
nosy: +python-dev

___
Python tracker 

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



[issue24633] README file installed into site-packages conflicts with package named "readme"

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 742aefb5ca46 by Steve Dower in branch 'default':
Issue #24633: Removes automatic rename of site-packages/README since README.txt 
is now committed.
https://hg.python.org/cpython/rev/742aefb5ca46

--

___
Python tracker 

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



[issue23235] run_tests.py doesn't set test.support.verbose correctly

2015-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Tests
nosy: +ezio.melotti, michael.foord, pitrou

___
Python tracker 

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



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-25 Thread Keith Teal

Keith Teal added the comment:

I would also like to add that the location of this directory is not correct for 
Windows software. This directory should be created in %APPDATA% where users by 
default do have write permissions.

If there are plans to ever make this application portable then it should 
support a command line option to specify the location of the configuration as 
well.

--
nosy: +tealduck

___
Python tracker 

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



[issue25425] white-spaces encountered in 3.4

2015-10-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Pavan, if you want to followup, please post to python-list where you can get 
help explaining whatever you see as a problem.  If you get agreement there that 
a patch to CPython is needed, we can reopen this.

--
nosy: +terry.reedy
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: performance -> 

___
Python tracker 

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



[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-25 Thread Steve Dower

Steve Dower added the comment:

We can add more options to the start menu icon, even something like "--start-in 
%userprofile%" should work there, as it really is just a blob of text (though I 
need to test that). Accepting "--start-in ~" and os.path.expanduser() would 
also be fine, I believe.

--

___
Python tracker 

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



[issue25469] multiprocessing .Condition.notify(_all) function has O(N) time complexity where N is the number of wait() calls with a timeout since the last notify(_all) call

2015-10-25 Thread SilentGhost

Changes by SilentGhost :


--
versions:  -Python 2.7, Python 3.2, Python 3.3, 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



[issue25468] PyTraceBack_Print()/_Py_DisplaySourceLine() should take custom loaders into account

2015-10-25 Thread Shiz

New submission from Shiz:

Currently, when an error occurs in a module loaded through a loader in 
sys.meta_path with no direct file name correlation on the filesystem, the 
traceback source line is empty as such:

  File "/Users/mark/Development/Projects/Rave/rave/rave/game.py", line 65, in 
run   
self.window.render(None)

  File "/.modules/sdl2/video/window.py", line 86, in render 

  File "/.modules/sdl2/video/window.py", line 259, in swap  

KeyboardInterrupt   

While the filename has no direct mapping on the file system, what it can do is 
just do the equivalent of module.__loader__.get_source('module') to retrieve 
the source code to find the appropriate line in, and only if that fails fall 
back on trying to interpret the module file name as a normal file system path.

--
components: Interpreter Core
messages: 253400
nosy: shiz
priority: normal
severity: normal
status: open
title: PyTraceBack_Print()/_Py_DisplaySourceLine() should take custom loaders 
into account
type: behavior
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



[issue25466] offer "from __future__ import" option for "raise... from"

2015-10-25 Thread alanf

New submission from alanf:

There is no "from __future__ import" option that would allow Python 2x users 
the "raise... from" syntax that is provided with Python 3. This is especially 
unfortunate because even if the "raise... from" is included in a branch that is 
never executed, loading the code in 2.7 can cause a seemingly unrelated 
exception (in my case, an import error for StringIO). Since my code must work 
in 2.7, 3.3, and 3.4, this is a problem.

I have found a workaround. If I want to achieve the equivalent of "raise XXX 
from None", for instance, I can do it as follows:

if hasattr(newExc, '__cause__'):
newExc.__cause__ = None
raise newExc

This works because the Exception class exists in all three Python versions, but 
only has a __cause__ attribute in Python 3. However, it's clumsier than I would 
like. Also, it's not obvious. 

I discovered that exception handling had changed when I saw that raising an 
exception when another one was active caused a "During handling of the above 
exception, another exception occurred" message on Python 3 (behavior that I 
didn't want) but was silently dropped in Python 2.7 (behavior that I did want). 
After I found a description of the "raise... from None" syntax in Python 3, I 
expected to find a "from __future__ import" statement that would handle this, 
but was disappointed. It took me a while longer to figure out the workaround 
above. I'd rather that other people didn't have to go through the process of 
figuring out the workaround.

--
messages: 253384
nosy: alanf
priority: normal
severity: normal
status: open
title: offer "from __future__ import" option for "raise... from"
type: enhancement
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



[issue25475] use argparse instead of getopt

2015-10-25 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

it's not for the pleasure, but there are two api for the command line. getopt 
and argparse. so in this case, what's the reason to keep both ? in particular 
if the documentation of getopt has a note with an alternative.

maybe to keep the backward compatibility, but in this case, maybe we can start 
to deprecate getopt in favour of argparse.

--

___
Python tracker 

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



[issue25154] Drop the pyvenv script

2015-10-25 Thread Brett Cannon

Brett Cannon added the comment:

Sorry for the delay on this; fell ill Friday and then had guests all weekend.

--
status: open -> closed

___
Python tracker 

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



[issue25356] Idle (Python 3.4 on Ubuntu) does not allow typing accents

2015-10-25 Thread Gian Carlo Martinelli

Gian Carlo Martinelli added the comment:

Any additional input on this issue?

--

___
Python tracker 

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



[issue25154] Drop the pyvenv script

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a5f8418b4ab by Brett Cannon in branch 'default':
Issue #25154: Make the file argument apply to the print function and
https://hg.python.org/cpython/rev/7a5f8418b4ab

--

___
Python tracker 

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



[issue25444] Py Launch Icon

2015-10-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Rockets are also used to launch communication satellites and scientific 
research missions.

On Windows, the IDLE icon has the double snake on a white page, while the 
python icon is the snakes on a dark console window.  They are already well 
differentiated.

However, the blue and yellow colors of the 16-bit version get darkened when 
placed in the top title bar of windows, and the snake shape a bit distorted. 
(idlelib/icons contains icons for both Windows and *nix.) They are even worse 
on Win10, so I have been thinking about redoing it. I might use your IDLE 
version to help with a redesign.

If you want the .exe icon changed, try to get support on python-list or 
python-ideas lists.

--
nosy: +terry.reedy
stage:  -> patch review

___
Python tracker 

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



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-25 Thread Keith Teal

Keith Teal added the comment:

Hi Terry,

I did not just make that stuff up on my last post, that is actually the 
standard for Windows applications. Yes, many Linux ports get it wrong but is 
that any reason to ever perpetuate a bad practice?

To see the standards you can download the Windows SDK but to make things easier 
for you here is a link that talks about this: 
http://blogs.msdn.com/b/patricka/archive/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions.aspx

By using non-standard conventions the application is just asking for trouble 
like what is being manifested with this issue. Users will be able to write to 
their %APPDATA% area, no administrator would lock that down as it would cause 
too many applications to fail (Kiosk type installations not included).

--

___
Python tracker 

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



[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-25 Thread Michael

Michael added the comment:

I should have looked more closely. 

The typo is part of the patch. It should be corrected there.

--

___
Python tracker 

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



[issue23237] Interrupts are lost during readline PyOS_InputHook processing (reopening)

2015-10-25 Thread Michiel de Hoon

Michiel de Hoon added the comment:

Anything I can do to help this patch move forward?

--

___
Python tracker 

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



[issue1749512] imaplib cannot handle mailboxes with ACL: lrs

2015-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.4, Python 3.5, Python 3.6 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2015-10-25 Thread David Beazley

David Beazley added the comment:

This bug is still present in Python 3.5, but it occurs if you attempt to do a 
readline() on a socket that's in non-blocking mode.  In that case, you probably 
DO want to retry at a later time (unlike the timeout case).

--

___
Python tracker 

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



[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-25 Thread eryksun

eryksun added the comment:

Steve, I think you're right that it's simpler and more reliable to add a 
command-line option that sets IDLE's working directory to the current user's 
home directory. 

Terry, the default behavior in Linux, at least in Ubuntu, is to start IDLE with 
the working directory set to the user's home directory. 

The Linux equivalent of a Windows .lnk shortcut is an XDG .desktop file [1]. A 
desktop application entry sets the working directory using the "Path" key, such 
as Path=/absolute/path (or also, and maybe only in Ubuntu Unity, 
Path=relative/path) in the main "Desktop Entry" or in a "Desktop Action" (i.e. 
right-click menu action). Environment variables are not supported. 

If "Path" isn't defined, I can only say from experience what Ubuntu's Unity 
shell does, since the spec doesn't define a default behavior. In this case, the 
child process inherits Unity's working directory. Since it's a plugin for the 
Compiz window manager, the child inherits the working directory of Compiz. This 
is the current user's $HOME directory, which Compiz inherits indirectly from 
the user-mode init process. I confirmed the behavior by attaching gdb to compiz 
and executing `call chdir("/home")`, and then continued compiz and opened IDLE 
to verify that the working directory was inherited as "/home". 

[1]: http://standards.freedesktop.org/desktop-entry-spec/latest

--

___
Python tracker 

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



[issue25471] socket.recv() blocks while it's gettimeout() returns 0.0

2015-10-25 Thread Alexey Gorshkov

Alexey Gorshkov added the comment:

telnet 127.0.0.1 9000 can be used as testing client

--

___
Python tracker 

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



[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-25 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue25470] Random Malloc error raised

2015-10-25 Thread augustin rieunier

Changes by augustin rieunier :


--
type:  -> crash

___
Python tracker 

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



[issue25471] socket.recv() blocks while it's gettimeout() returns 0.0

2015-10-25 Thread Alexey Gorshkov

Changes by Alexey Gorshkov :


Removed file: http://bugs.python.org/file40855/s1.py

___
Python tracker 

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



[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This would be easier to evaluate propertly if you supplied some meaningful use 
cases.  Otherwise, it is looks like hypergeneralizing.

--
nosy: +rhettinger

___
Python tracker 

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



[issue24747] ctypes silently truncates ints larger than C int

2015-10-25 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

I wouldn't call it so carved in stone:

1) The note at `ctypes.c_int' 
(https://docs.python.org/2/library/ctypes.html?highlight=c_int#ctypes.c_int) is 
meant for explicit conversion - since the entry is about using `c_int' is 
Python code, not converting something to `int' anywhere in Python's codebase. 
(thus, eryksun's statement is but a liberal interpretation)

2) 15.17.1.3. 
(https://docs.python.org/2/library/ctypes.html?highlight=c_int#calling-functions)
 is a tutorial, rather than reference, section, and as such, is not an 
authoritative source. And the corresponding reference section, 15.17.2.3. 
(https://docs.python.org/2/library/ctypes.html?highlight=c_int#foreign-functions)
 has nothing of the kind.
Basically, when seen in a non-normative text, such a piece of information is 
interpreted as a "taking into a secret": "this is what happens behind the 
scenes - so you better understand it - but don't rely on this too much".

Anyway, to produce convincing evidence to change anything, one probably needs 
to dig up the rationale for the current behaviour and see what adheres to it / 
if it still stands.

Sure, this violates Python Zen (koans 2 and 12), yet we probably need something 
better that this to convince core devs that this is a _bug_.

--
nosy: +Ivan.Pozdeev

___
Python tracker 

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



[issue25471] socket.recv() blocks while it's gettimeout() returns 0.0

2015-10-25 Thread Alexey Gorshkov

Changes by Alexey Gorshkov :


Added file: http://bugs.python.org/file40856/s1.py

___
Python tracker 

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



[issue25474] Weird behavior when setting f_trace in a context manager

2015-10-25 Thread Fred Gansevles

New submission from Fred Gansevles:

I'm playing with the idea of making a DSL based on anonynous code blocks

I discovered that the behaviour of the context manager is different in some 
cases if there are line-continuations in the 'with' command

I've attached a script that reproduces this behaviour.

With both Python 2.7.6 and Python 3.4.3 I get the same results.


Fred.

--
files: as_context.py
messages: 253426
nosy: Fred Gansevles
priority: normal
severity: normal
status: open
title: Weird behavior when setting f_trace in a context manager
type: behavior
Added file: http://bugs.python.org/file40858/as_context.py

___
Python tracker 

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



[issue25447] TypeError invoking deepcopy on lru_cache

2015-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It is redundant. update_wrapper() is called just after calling 
_lru_cache_wrapper() in decorating_function().

--

___
Python tracker 

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



[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Perhaps add after third sentence (ending with "not accepted)."), "If classinfo 
is a tuple, isinstance(x, classinfo) is the same as any(isinstance(x, C) for C 
in flatten(classinfo))".

--
nosy: +terry.reedy
stage:  -> needs patch
title: isinstance documentation doesn't explain what happens when type is tuple 
-> isinstance documentation: explain behavior when type is a tuple
type:  -> enhancement
versions: +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



[issue25356] Idle (Python 3.4 on Ubuntu) does not allow typing accents

2015-10-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am out of ideas.  You might ask on python-list (accessible as newsgroup 
mirror on news.gmane.org) whether any other Ubunto users have the problem or 
have heard of it.

--

___
Python tracker 

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



[issue25469] multiprocessing .Condition.notify(_all) function has O(N) time complexity where N is the number of wait() calls with a timeout since the last notify(_all) call

2015-10-25 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +jnoller, sbt

___
Python tracker 

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



[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Library (Lib)
nosy: +alexandre.vassalotti, gvanrossum, pitrou, serhiy.storchaka
type:  -> behavior
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



[issue22968] Lib/types.py nit: isinstance != PyType_IsSubtype

2015-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +yselivanov
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



[issue17864] IDLE won't run

2015-10-25 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
superseder:  -> Unable to run IDLE without write-access to home directory

___
Python tracker 

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



[issue25475] use argparse instead of getopt

2015-10-25 Thread R. David Murray

R. David Murray added the comment:

This was discussed when argparse was included in the standard library, and the 
conclusion was that getopt serves a different purpose than argparse and should 
not be deprecated.  argparse is mentioned as an alternative since in many cases 
it is to be preferred, but there are cases where getopt is the better choice.  
(I myself have a command line parsing library (not yet published) that uses 
getopt as its base.)

As far as using argparse in the standard library, yes, we convert modules on a 
case by case basis when someone has the interest and the time to write tests 
for the existing command line behavior before doing the conversion.  And in 
every case we have still introduced bugs when the conversion was released, so 
this should not be done lightly (ie: we usually only do it when introducing new 
functionality or fixing a bug).

--
nosy: +r.david.murray
stage:  -> resolved

___
Python tracker 

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



[issue25456] 3.4 _tkinter build requires undocumented manual steps to be usable

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b5889dbbc382 by Zachary Ware in branch '3.4':
Closes #25456: Copy Tcl/Tk DLLs to build directory on Windows
https://hg.python.org/cpython/rev/b5889dbbc382

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> 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



[issue1182143] making builtin exceptions more informative

2015-10-25 Thread George Jenkins

George Jenkins added the comment:

Bump on this one please

--

___
Python tracker 

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



[issue25193] itertools.accumulate should have an optional initializer argument

2015-10-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> OTOH, none of those projects is natural fit for itertools,
> so changing itertools wouldn't help them directly.

Indeed, this may not be a natural fit for itertools problems.

As a side note, the itertools were designed to form the elements of "an 
iterator algebra" with itertools.chain() as the intended compose-operation, so 
the OPs original solution was the right way to do it.  

The main question is whether the current solution is common enough to warrant 
being made a little more convenient (saving 9 characters), and whether the 
resulting code reads well:

current:  accumulate(chain([10]), range(1,4), operator.mul)
proposed: accumulate(range(1,4), operator.mul, 10) 

The latter spelling saves 9 characters; however, to my eyes, the "10" isn't 
obvious about what it doing and its placement is odd (the order of execution is 
10, 1, 2, 3 eventhough the argument order has the range(1,4) as the first 
argument and the "10" as the third-argument).  I don't think the proposed 
spelling is doing us any favors in terms of code clarity -- the current 
spelling with chain() is more versatile and makes it perfectly clear that the 
10 happens before the 1,2,3.

The OP made reference to functools.reduce() for comparison but we should keep 
in mind that reduce() was banished to functools because Guido found it to be 
relatively unintelligible and thought most code would be clearer without it.

As an additional data point, I did a GitHub code search.  In the first 20 pages 
of the search results, I found only three examples.  The first example seems 
reasonable.  The second example was a toy demonstration of "generator and 
iterator towers".  And the third example was a olympiad toy puzzle problem.

Github Code Search
--
https://github.com/search?p=1=itertools.accumulate=searchresults=Code=%E2%9C%93


Ex1:

def collect(seed, iterable):
return it.accumulate(it.chain([seed], iterable))

Ex2:

for number, op, fac in itertools.chain(
 zip(itertools.accumulate(itertools.chain((nr,), range(2, 10)),
 operator.mul), itertools.repeat(" * "), range(2, 10)),

Ex3:

if sum(loop) % 2015 == 0 and not list(filter(test,
  itertools.accumulate(itertools.chain(start, loop:
  print(0)

--

___
Python tracker 

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



[issue25193] itertools.accumulate should have an optional initializer argument

2015-10-25 Thread Alun Champion

Alun Champion added the comment:

If you are looking for other examples.
Here's a wheel factorization of an indefinite sieve (primes) that was peer 
reviewed on codereview.stackexchange.com, see the final result in the last post 
by Will Ness: 
http://codereview.stackexchange.com/questions/92365/wheel-based-unbounded-sieve-of-eratosthenes-in-python
 which included two uses of accumulate(chain(...), ...).

Constructing and unpacking the list in a chain seems like an unnecessary 
overhead when all you are looking for is an initial value. The reason I 
suggested it as the 3rd argument is it is the "most" optional argument and 
mirrors reduce (though iterable, function is the reverse of reduce).

--

___
Python tracker 

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



[issue25451] tkinter: PhotoImage transparency methods

2015-10-25 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +serhiy.storchaka, terry.reedy
stage:  -> needs patch
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



[issue25473] socket.recv() raises correct code with the misleading description 'BlockingIOError: [Errno 11] Resource temporarily unavailable'

2015-10-25 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This is simply the way glibc defines the error messages.

% python3
Python 3.4.3 (default, Sep 27 2015, 15:15:25) 
[GCC 4.8.5] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno, os
>>> errno.EAGAIN, errno.EWOULDBLOCK
(11, 11)
>>> os.strerror(errno.EAGAIN)
'Resource temporarily unavailable'

--
nosy: +benjamin.peterson
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



[issue25478] Consider adding a normalize() method to collections.Counter()

2015-10-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue21593] Clarify re.search documentation first match

2015-10-25 Thread Joshua Landau

Changes by Joshua Landau :


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



[issue25439] Add type checks to urllib.request.Request

2015-10-25 Thread Nan Wu

Changes by Nan Wu :


Added file: 
http://bugs.python.org/file40850/urllib_request_param_type_check_3.patch

___
Python tracker 

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



[issue1749512] imaplib cannot handle mailboxes with ACL: lrs

2015-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +email
nosy: +barry, r.david.murray

___
Python tracker 

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



[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2015-10-25 Thread David Beazley

New submission from David Beazley:

First comment: In the I/O library, there is documented behavior for how things 
work in the presence of non-blocking I/O.  For example, read/write methods 
returning None on raw file objects.  Methods on BufferedIO instances raise a 
BlockingIOError for operations that can't complete. 

However, the implementation of close() is currently broken.  If buffered I/O is 
being used and a file is closed, it's possible that the close will fail due to 
a BlockingIOError occurring as buffered data is flushed to output.  However, in 
this case, the file is closed anyways and there is no possibility to retry.  
Here is an example to illustrate:

>>> from socket import *
>>> s = socket(AF_INET, SOCK_STREAM)
>>> s.connect(('somehost', port))
>>> s.setblocking(False)
>>> f = s.makefile('wb', buffering=1000)   # Large buffer
>>> f.write(b'x'*100)
>>>

Now, watch carefully

>>> f
<_io.BufferedWriter name=4>
>>> f.closed
False
>>> f.close()
Traceback (most recent call last):
  File "", line 1, in 
BlockingIOError: [Errno 35] write could not complete without blocking
>>> f
<_io.BufferedWriter name=-1>
>>> f.closed
True
>>>

I believe this can be fixed by changing a single line in 
Modules/_io/bufferedio.c:

--- bufferedio_orig.c   2015-10-25 16:40:22.0 -0500
+++ bufferedio.c2015-10-25 16:40:35.0 -0500
@@ -530,10 +530,10 @@
 res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL);
 if (!ENTER_BUFFERED(self))
 return NULL;
-if (res == NULL)
-PyErr_Fetch(, , );
-else
-Py_DECREF(res);
+if (res == NULL) 
+  goto end;
+else 
+  Py_DECREF(res);
 
 res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_close, NULL);

With this patch, the close() method can be retried as appropriate until all 
buffered data is successfully written.

--
components: IO
messages: 253438
nosy: dabeaz
priority: normal
severity: normal
status: open
title: close() behavior on non-blocking BufferedIO objects with sockets
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



[issue25477] text mode for pkgutil.get_data

2015-10-25 Thread Antony Lee

New submission from Antony Lee:

Initially suggested in #25330: it would be helpful to provide text mode support 
(returning unicode, and handling universal newlines) for pkgutil.get_data 
(either as a keyword argument, or as a separate function).

--
components: Library (Lib)
messages: 253441
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: text mode for pkgutil.get_data
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



[issue25469] multiprocessing .Condition.notify(_all) function has O(N) time complexity where N is the number of wait() calls with a timeout since the last notify(_all) call

2015-10-25 Thread Vilnis Termanis

Vilnis Termanis added the comment:

A few additional notes:

1) On an AMD E-450 under Ubuntu 14.04 x64 with a current in-development build, 
when running condition_test.py, Condition.notify_all() takes (measure using 
time.clock) 0.0003 with the patch and 0.3219 without it. Additionally the 
in-script timeit calls seem to suggest that the patch does not adversely affect 
Condition.wait().

2) Unit tests have also been run against test_multiprocessing_forkserver (typo 
in original message).

3) A scenario where this might become apparent would be to have many worker 
processes which have a loop along the lines of:

while not event.is_set():
  do_more_work()
  # Pause because the task is only supposed to happen every X seconds
  # or a wait is in effect due to an error. Do not want to use
  # time.sleep so loop is exited promptly rather than blindly sleeping.
  event.wait(some_amount)
other_work_or_shutdown()

If many processes call event.wait() with a timeout and the event is not set 
often (e.g. since it's a shutdown flag), a long-running program with many 
worker processes can end up having event.set() take a considerable amount of 
time.

--

___
Python tracker 

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



[issue18010] pydoc search chokes on import errors

2015-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: needs patch -> test needed
versions: +Python 3.5, Python 3.6 -Python 3.3

___
Python tracker 

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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue892902] problem with pickling newstyle class instances

2015-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that backports recursive objects handling to 2.7.

--
keywords: +patch
nosy: +serhiy.storchaka
stage: needs patch -> patch review
Added file: http://bugs.python.org/file40859/pickle_recursive-2.7.patch

___
Python tracker 

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



[issue25154] Drop the pyvenv script

2015-10-25 Thread Stefan Behnel

Stefan Behnel added the comment:

May I ask how difficult it is for any of the core developers to fix a known 
typo in a Python source file?

--
nosy: +scoder

___
Python tracker 

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



[issue25465] Pickle uses O(n) memory overhead

2015-10-25 Thread Eric V. Smith

Eric V. Smith added the comment:

In what way does the OS crash? Are there any kernel messages? Or is this the 
python executable crashing? Again, if so, what messages are printed?

In any event, if this really is an OS crash, then it's a Linux bug and should 
be reported to them.

--
nosy: +eric.smith

___
Python tracker 

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



[issue25465] Pickle uses O(n) memory overhead

2015-10-25 Thread Herbert

Herbert added the comment:

That sound reasonable regarding why O(n), but it does not explain why linux 
crashes (I've seen this on two ubuntu systems)if pickle runs out of memory.

--

___
Python tracker 

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



[issue21160] incorrect comments in nturl2path.py

2015-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your patch Jurko.

--
resolution:  -> fixed
stage: commit review -> 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



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Idle is not unique.  Several other apps ported from unix also put .xyx files in 
the home directory on Windows. What is unusual, if not unique, about IDLE is 
the need to run multiple versions. If .idlerc is moved, already released 
versions will not be able to access it.  I am not ready to make a break yet.  
In any case, moving it to a subdirectory of $HOME will not solve this issue, 
which is not being able to write to $HOME, and it therefore a different issue.

--
versions: +Python 3.5, Python 3.6 -Python 3.3

___
Python tracker 

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



[issue25466] offer "from __future__ import" option for "raise... from"

2015-10-25 Thread R. David Murray

R. David Murray added the comment:

I doubt we are going to add such a feature to python2 at this point, since 
people have worked out various workarounds (see the six module). We do not at 
this point add features to python2 unless there's a really compelling reason 
(eg: security).

--
nosy: +r.david.murray

___
Python tracker 

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



[issue21160] incorrect comments in nturl2path.py

2015-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> commit review
type:  -> enhancement
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



[issue25469] multiprocessing .Condition.notify(_all) function has O(N) time complexity where N is the number of wait() calls with a timeout since the last notify(_all) call

2015-10-25 Thread Vilnis Termanis

Changes by Vilnis Termanis :


Added file: http://bugs.python.org/file40854/condition_test.py

___
Python tracker 

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



[issue25472] Typing: Specialized subclasses of generics cannot be unpickled

2015-10-25 Thread Matt Chaput

New submission from Matt Chaput:

If I try to pickle and unpickle an object of a class that has specialized a 
generic superclass, when I try to unpickle I get this error:

TypeError: descriptor '__dict__' for 'A' objects doesn't apply to 'B' object

Test case:

from typing import Generic, TypeVar
import pickle

T = TypeVar("T")


class A(Generic[T]):
def __init__(self, x: T):
self.x = x


class B(A[str]):
def __init__(self, x: str):
self.x = x


b = B("hello")
z = pickle.dumps(b)
print(z)
_ = pickle.loads(z)

--
messages: 253421
nosy: maatt
priority: normal
severity: normal
status: open
title: Typing: Specialized subclasses of generics cannot be unpickled
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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

Usually docstrings are short and to the point, and serve more as a remainder, 
whereas the online docs explain everything in detail.
Also rst markup in docstrings would be distractings, so we keep docstrings and 
online docs separated, even though there is often some overlapping.

--

___
Python tracker 

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



[issue25471] socket.recv() blocks while it's gettimeout() returns 0.0

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 10e044a734f3 by Benjamin Peterson in branch '3.4':
accepted sockets shouldn't inherit the SOCK_NONBLOCK flag (closes #25471)
https://hg.python.org/cpython/rev/10e044a734f3

New changeset 7577960ea17b by Benjamin Peterson in branch '3.5':
merge 3.4 (#25471)
https://hg.python.org/cpython/rev/7577960ea17b

New changeset 347221cfa224 by Benjamin Peterson in branch 'default':
merge 3.5 (#25471)
https://hg.python.org/cpython/rev/347221cfa224

--
nosy: +python-dev
resolution:  -> fixed
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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread STINNER Victor

STINNER Victor added the comment:

> If you want to avoid ineffective because its meaning is subtle (a reasonable 
> request), the correct replacement would be "modifying dirnames has no effect 
> on the behavior of the walk", which is wordier but clearer.

I prefer the new sentence, it's more explicit. Maybe I pushed the change too 
fast.

@David: are you ok with the change?

--

___
Python tracker 

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



[issue23255] SimpleHTTPRequestHandler refactor for more extensible usage.

2015-10-25 Thread Ent

Ent added the comment:

Hi,

Is it possible for this patch to be reviewed now?

Regards,
Ent

--

___
Python tracker 

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



[issue25467] Put “deprecated” warnings first

2015-10-25 Thread Tony R.

New submission from Tony R.:

Python has wonderful, detailed documentation.  I love it!

Unfortunately, I have often found myself reading the otherwise-excellent 
documentation on a class/function/whatever, only to find out at the END of my 
reading that it is deprecated.

This is frustrating, and counter-intuitive.  If something is deprecated, I want 
to know it before I read any further.  

I have attached a patch with the relevant changes.  I hope it helps!

--
assignee: docs@python
components: Documentation
files: 0001-Move-deprecated-blocks-to-the-beginning-of-their-doc.patch
keywords: patch
messages: 253391
nosy: Tony R., docs@python
priority: normal
severity: normal
status: open
title: Put “deprecated” warnings first
type: enhancement
Added file: 
http://bugs.python.org/file40851/0001-Move-deprecated-blocks-to-the-beginning-of-their-doc.patch

___
Python tracker 

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



[issue25456] 3.4 _tkinter build requires undocumented manual steps to be usable

2015-10-25 Thread Zachary Ware

Zachary Ware added the comment:

Should be fixed now, please test?  I think everything is now covered in 
readme.txt as well.

--

___
Python tracker 

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



[issue25455] Some repr implementations don't check for self-referential structures

2015-10-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> high
stage:  -> needs patch

___
Python tracker 

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



[issue20438] inspect: Deprecate getfullargspec?

2015-10-25 Thread Ned Batchelder

Ned Batchelder added the comment:

I'm confused: the discussion here is mostly about updating docs to note 
deprecation.  Then at the very end, is an off-hand remark about removing 
getargspec.

The docs for getargspec currently read, "This function will be removed in 
Python 3.6."  Why?  We keep all sorts of old APIs for the sake of backward 
compatibility, why is this one different?

--
nosy: +nedbat

___
Python tracker 

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



[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-25 Thread Steve Dower

Steve Dower added the comment:

Unfortunately it looks like MSI won't let you put an environment variable into 
the shortcut, as it has to resolve it on install (see WkDir at 
https://msdn.microsoft.com/en-us/library/aa371847(VS.85).aspx)

Trying some other ideas, but it looks like the most robust solution will be for 
IDLE to change the current directory on startup (maybe via a command line 
option?), or specify the initial directory in its open/save dialogs.

Otherwise, the best I can realistically promise is to set it to the Python 
install directory, which is not particularly useful either...

--

___
Python tracker 

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



[issue25470] Random Malloc error raised

2015-10-25 Thread augustin rieunier

New submission from augustin rieunier:

Hello there, 
I face random malloc error in my code.
I recently added lots of json dumps/loads operation as I plugged my application 
with redis.

Here's the error raised, and Valgrind information right after:

127.0.0.1 - - [24/Oct/2015 15:57:44] "DELETE 
/api/private/v1.0/contentcategories/ HTTP/1.1" 404 -
python: malloc.c:2372: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) 
&((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd 
&& old_size == 0) || ((unsigned long) (old_size) >= (unsigned 
long)__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 
*(sizeof(size_t))) - 1)) & ~((2 *(sizeof(size_t))) - 1))) && ((old_top)->size & 
0x1) && ((unsigned long) old_end & pagemask) == 0)' failed.
==18768== Invalid read of size 4
==18768==at 0x55ACE1: PyObject_Free (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x52AB40: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x546605: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x5BB178: _PyGC_CollectNoFail (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x566C18: PyImport_Cleanup (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469C8E: Py_Finalize (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469D82: Py_Exit (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469EC0: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469EDE: PyErr_PrintEx (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x47BE98: PyRun_SimpleFileExFlags (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x5BF712: Py_Main (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x47E350: main (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==  Address 0x6d70020 is 1,536 bytes inside a block of size 1,568 free'd
==18768==at 0x4C2BDEC: free (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18768==by 0x5540D5: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x5465F4: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x5BB178: _PyGC_CollectNoFail (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x566C18: PyImport_Cleanup (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469C8E: Py_Finalize (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469D82: Py_Exit (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469EC0: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469EDE: PyErr_PrintEx (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x47BE98: PyRun_SimpleFileExFlags (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x5BF712: Py_Main (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x47E350: main (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768== 
==18768== Invalid read of size 4
==18768==at 0x55ACE1: PyObject_Free (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x529CE6: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x553633: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x553728: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x5465F4: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x5BB178: _PyGC_CollectNoFail (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x566C18: PyImport_Cleanup (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469C8E: Py_Finalize (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469D82: Py_Exit (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469EC0: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x469EDE: PyErr_PrintEx (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x47BE98: PyRun_SimpleFileExFlags (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==  Address 0x7dc6020 is 144 bytes inside a block of size 224 free'd
==18768==at 0x4C2BDEC: free (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18768==by 0x553459: ??? (in 
/home/dev/Desktop/PROJ/git/api_clone/api/flask/bin/python3.4)
==18768==by 0x4B26B6: PyEval_EvalFrameEx (in 

[issue25447] TypeError invoking deepcopy on lru_cache

2015-10-25 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Simple and elegant. I like it.

--

___
Python tracker 

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



[issue9051] Improve pickle format for timezone aware datetime instances

2015-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following patch adds tests for timezone pickling and copying. Note, that 
timezone.utc identity is preserved.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file40852/timezone_test_pickle.patch

___
Python tracker 

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



[issue892902] problem with pickling newstyle class instances

2015-10-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: test needed -> needs patch
versions:  -Python 3.1, Python 3.2

___
Python tracker 

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



[issue18010] pydoc search chokes on import errors

2015-10-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The patch looks good.

--
nosy: +rhettinger

___
Python tracker 

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



[issue25456] 3.4 _tkinter build requires undocumented manual steps to be usable

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 168569414215 by Zachary Ware in branch '3.4':
Issue #25456: Fix test_idle when Tcl/Tk DLLs are loaded from python.exe's home
https://hg.python.org/cpython/rev/168569414215

--

___
Python tracker 

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



[issue25475] use argparse instead of getopt

2015-10-25 Thread SilentGhost

SilentGhost added the comment:

This seems like a change for the sake of change. I think any module that 
requires argparse features can be moved in its own time.

--
nosy: +SilentGhost
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



[issue25473] socket.recv() raises correct code with the misleading description 'BlockingIOError: [Errno 11] Resource temporarily unavailable'

2015-10-25 Thread Alexey Gorshkov

New submission from Alexey Gorshkov:

(in continuation to bug https://bugs.python.org/issue25471 )

socket.recv() raises 'BlockingIOError: [Errno 11] Resource temporarily 
unavailable' in case, if setblocking(False) on socket returned by non-blocking 
socket's .accept() method and client does not sending data and didn't 
disconnected yet.

Not sure if I'm correct, but reading glibc doc on recv(), I think raised 
exception should be corrected: while code 11 correctly corresponds to 
EWOULDBLOCK, the misleading description 'Resource temporarily unavailable', 
probably, should be changed:
---
'EWOULDBLOCK'
  Nonblocking mode has been set on the socket, and the read
  operation would block.  (Normally, 'recv' blocks until there
  is input available to be read.)
---

attached file with testing server corrected for this issue

--
files: s1.py
messages: 253425
nosy: animus
priority: normal
severity: normal
status: open
title: socket.recv() raises correct code with the misleading description 
'BlockingIOError: [Errno 11] Resource temporarily unavailable'
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file40857/s1.py

___
Python tracker 

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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0286bb18a351 by Victor Stinner in branch '3.4':
Issue #25461: Rephrase os.walk() doc
https://hg.python.org/cpython/rev/0286bb18a351

New changeset 9f68e41fb4a7 by Victor Stinner in branch '3.5':
Merge 3.4 (Issue #25461)
https://hg.python.org/cpython/rev/9f68e41fb4a7

New changeset db07937b3e49 by Victor Stinner in branch 'default':
Merge 3.4 (Issue #25461)
https://hg.python.org/cpython/rev/db07937b3e49

--
nosy: +python-dev

___
Python tracker 

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



[issue21160] incorrect comments in nturl2path.py

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6a15845142ec by Serhiy Storchaka in branch '3.4':
Issue21160: Correct comments in nturl2path.  Patch by Jurko Gospodnetić.
https://hg.python.org/cpython/rev/6a15845142ec

New changeset acc453391c5b by Serhiy Storchaka in branch '2.7':
Issue21160: Correct comments in nturl2path.  Patch by Jurko Gospodnetić.
https://hg.python.org/cpython/rev/acc453391c5b

New changeset 67dfa5cf38c2 by Serhiy Storchaka in branch '3.5':
Issue21160: Correct comments in nturl2path.  Patch by Jurko Gospodnetić.
https://hg.python.org/cpython/rev/67dfa5cf38c2

New changeset 1216494acffe by Serhiy Storchaka in branch 'default':
Issue21160: Correct comments in nturl2path.  Patch by Jurko Gospodnetić.
https://hg.python.org/cpython/rev/1216494acffe

--
nosy: +python-dev

___
Python tracker 

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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread Bernt Røskar Brenna

Bernt Røskar Brenna added the comment:

A question/comment:

In this case (and there are probably other cases like it) - it seems to me that 
the docstring (in os.py) and the docs (in os.rst) are similar enough that the 
docstring from the code could be included in the docs (using Sphinx's autodoc).

What is the preferred way? Is there a reason to have it the way it is? I notice 
the .rst docs have some formatting applied, is it considered not OK to put 
formatting in docstrings?

--

___
Python tracker 

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



[issue25465] Pickle uses O(n) memory overhead

2015-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

That is because a pickler keeps track of all pickled objects. This is needed to 
preserve identity and support recursive objects.

You can disable memoizing by setting the "fast" attribute of the Pickler object.

def fastdump(obj, file):
p = pickle.Pickler(file)
p.fast = True
p.dump(obj)

But you can't pickle recursive objects in the "fast" mode.

--
nosy: +alexandre.vassalotti, pitrou, serhiy.storchaka

___
Python tracker 

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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8247dff49113 by Victor Stinner in branch '2.7':
Issue #25461: Rephrase os.walk() doc
https://hg.python.org/cpython/rev/8247dff49113

--

___
Python tracker 

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



[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-25 Thread Evgeny Kapun

Evgeny Kapun added the comment:

There are methods that accept a single argument and behave like a binary 
operation or a predicate. It would be useful to be able to turn them into 
binary functions for use with higher-order functions like map and reduce:

reduce(methodcaller("combine"), objs) # reduce a sequence using "combine" 
method
map(methodcaller("combine"), alist, blist) # combine pairs of elements
all(map(methodcaller("compatible_with"), alist, blist)) # check that pairs 
of elements are compatible

This functionality is already available for overloaded operators, because 
operator module provides them as functions. Some methods behave similarly to 
operators, so I think that a similar functionality should be available for them 
as well.

--

___
Python tracker 

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



[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2015-10-25 Thread Marcin Szewczyk

Changes by Marcin Szewczyk :


--
nosy: +wodny

___
Python tracker 

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



[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I see the problem: there is only one IDLE icon for all users, so you need the 
env var to customize for each user, which you cannot use. Staying with the 
python install directory, as before, should be better.  We never got any 
complaints about that.  But the new install locations are more problematical.

I have also thought of adding an new startup option, but it should only apply 
if IDLE is started with the ICON.  When started at the command line, it should 
start at the current directory of the console, as it does now, so '.' refers to 
that directory.  Ironically, a current directory of .../system32 would be a 
good indicator.  I need to see what is in sys.argv after the different start 
methods.

This issue is currently only for Windows. I don't know what happens on other 
systems or whether they could stand improvement.

--

___
Python tracker 

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



[issue25447] TypeError invoking deepcopy on lru_cache

2015-10-25 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Can you speak to why 'update_wrapper' should be removed? Is that indicative of 
a deeper issue with update_wrapper also not supporting pickle/deepcopy?

--

___
Python tracker 

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



[issue20438] inspect: Deprecate getfullargspec?

2015-10-25 Thread Yury Selivanov

Yury Selivanov added the comment:

> The docs for getargspec currently read, "This function will be removed in 
> Python 3.6."  Why?  We keep all sorts of old APIs for the sake of backward 
> compatibility, why is this one different?

getargspec was deprecated since 3.0.  Besides that, it returns incomplete 
information about function parameters: keyword-only parameters won't be 
introspected at all for instance.

Migration path is very simple and clear -- just use getfullargspec (almost 100% 
backwards compatible), which won't be removed probably till Python 4.

--

___
Python tracker 

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



[issue25154] Drop the pyvenv script

2015-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixing a typo is trivial.  If the typo affects several version the changeset 
needs to be merged on all the applicable branches before being pushed.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue17214] http.client.HTTPConnection.putrequest encode error

2015-10-25 Thread Michael

Michael added the comment:

The patch issue17214 did fix this issue in my 3.4.2 install on Ubuntu LTS.

It triggered however another bug:

  File "/usr/local/lib/python3.4/urllib/request.py", line 646, in http_error_302
path = urlparts.path if urlpaths.path else "/"
NameError: name 'urlpaths' is not defined

This is obviously a typo. 

I'm not sure if that one has been reported yet (a short google search didn't 
find anything) and I don't know how to provoke it independently.

--
nosy: +Strecke
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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread STINNER Victor

STINNER Victor added the comment:

We don't use autodoc. It would be "nice" to have a tool to update .rst
files from .py and .c files, but it's not the case right now :-/

--

___
Python tracker 

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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread Bernt Røskar Brenna

Bernt Røskar Brenna added the comment:

Yet another patch, this time including changes to os.walk()'s docstring as well.

Ignore the two other files.

--
Added file: http://bugs.python.org/file40849/os_walk_doc.patch

___
Python tracker 

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



[issue25475] use argparse instead of getopt

2015-10-25 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

and optparse.

In fact, we have getopt, optparse and argparse. 3 API for the command line.

optparse is marked as deprecated.
maybe we can add getopt in this list.

--

___
Python tracker 

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



[issue25469] multiprocessing .Condition.notify(_all) function has O(N) time complexity where N is the number of wait() calls with a timeout since the last notify(_all) call

2015-10-25 Thread Vilnis Termanis

New submission from Vilnis Termanis:

multiprocessing's Condition uses a couple of semaphores to keep track of
processes which are sleeping and have woken up whilst waiting for the
condition. These counters however are only ever decremented in the
notify(_all) functions, via a loop which results in somewhat unexpected
behaviour where said functions take longer to run than expected.

The proposed patch simplifies notify(_all) functions such that time complexity
is still O(N) but crucially N is the number of currently sleeping processes
only (rather than number of wait() calls since last notify(_all) call).

Note: This also affects Event.wait() & Event.set() in the same fashion since a
Condition is used under the hood.

I've attached mp_sync_condition.patch based on "in-development" branch as of
98840:2028aed246c0. I have run unit tests on said commit (via debug build)
using:

./python -bb -E -Wd -m test -r -v -uall\
test_multiprocessing_fork\
test_multiprocessing_fork\
server test_multiprocessing_spawn

Additionally I've run condition_test.py before & after to illustrate performance
of the proposed change as well as demonstrate the issue.

--
components: Library (Lib)
files: mp_sync_condition.patch
keywords: patch
messages: 253403
nosy: vilnis.termanis
priority: normal
severity: normal
status: open
title: multiprocessing .Condition.notify(_all) function has O(N) time 
complexity where N is the number of wait() calls with a timeout since the last 
notify(_all) call
type: performance
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40853/mp_sync_condition.patch

___
Python tracker 

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



[issue18010] pydoc search chokes on import errors

2015-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Would be nice to have a test.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2015-10-25 Thread STINNER Victor

STINNER Victor added the comment:

"Also rst markup in docstrings would be distractings, so we keep docstrings and 
online docs separated, even though there is often some overlapping."

Ah yes, and the doc in Doc/ directory contains more information like ".. 
versionchanged:: (...)", ".. versionadded:: (...)", links to other doc using 
reST markups, etc.

In general, the doc in Doc/ is higher quality than docstrings ;)

--

___
Python tracker 

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



[issue25475] use argparse instead of getopt

2015-10-25 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

not sure, but in the documentation, there is a note
"Module argparse: Alternative command line option and argument parsing library."

may be it's time to move from getopt to argparse and mark getopt as deprecated.

We have to modify 45 files, but I can submit a separated patch for each file.

ack "import getopt" -l | wc -l
  45

--
components: Library (Lib)
messages: 253429
nosy: matrixise
priority: normal
severity: normal
status: open
title: use argparse instead of getopt
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



[issue25471] socket.recv() blocks while it's gettimeout() returns 0.0

2015-10-25 Thread Alexey Gorshkov

New submission from Alexey Gorshkov:

socket created with listening socket set to setblocking(False). gettimeout() of 
accept()-returned socket returns 0.0 , but recv() method blocks while client is 
connected and not sending any data. If client disconnects, socket returned by 
accept() starting return 0-length bytes string without blocking.

glibc doc on recv():
---
If nonblocking mode is set for SOCKET, and no data are available to be read, 
'recv' fails immediately rather than waiting.
---

testing server and client code attached.

tested with Python 3.5.0 and Python 2.7.10

--
files: s1.py
messages: 253418
nosy: animus
priority: normal
severity: normal
status: open
title: socket.recv() blocks while it's gettimeout() returns 0.0
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file40855/s1.py

___
Python tracker 

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