[issue26765] Factor out common bytes and bytearray implementation

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Stage 4 patch moves thin wrappers around functions from bytes_methods.c to 
Objects/stringlib/transmogrify.h. The _method_ suffix is added to some names to 
distinguish them from existing stringlib names.

I'm not sure this is a good place. It may be better to add separate file (I'm 
going to move more simple wrappers here), but I don't have good name for it 
(bytes_methods.h is already used). Any ideas?

--
Added file: http://bugs.python.org/file42730/bytes_methods_stage4.patch

___
Python tracker 

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



[issue26961] Provide an API to help debug super().__getattribute__ results

2016-05-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Actually, since this is intended primarily for debugging:

Doug, do you actually need the type information? Or would combining 
inspect.getsourcefile() and inspect.getlines() with super().__init__ to locate 
the source code for the offending method implementation be sufficient?

If that's the case, then the only benefit of this API would be to extend such 
debugging to extension module types in addition to regular Python classes.

--

___
Python tracker 

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



[issue26765] Factor out common bytes and bytearray implementation

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Meador.

Stage 3 patch is simple. It just adds guards in bytes-specific and 
unicode-specific template files to be sure that they are not used with wrong 
type.

--
Added file: http://bugs.python.org/file42729/bytes_methods_stage3.patch

___
Python tracker 

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



[issue26765] Factor out common bytes and bytearray implementation

2016-05-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f4406d746d27 by Serhiy Storchaka in branch 'default':
Issue #26765: Moved common code for the replace() method of bytes and bytearray
https://hg.python.org/cpython/rev/f4406d746d27

--

___
Python tracker 

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



[issue26961] Provide an API to help debug super().__getattribute__ results

2016-05-04 Thread Nick Coghlan

Nick Coghlan added the comment:

The main reason for suggesting operator is that it needs to be in an extension 
module if it's going to share the underlying lookup algorithm used by 
super().__getattribute__ rather than reimplementing it.

I'm not particularly concerned about the exact API name though, so I changed 
the title of the issue to explain the problem to be solved, rather than to 
propose a particular solution.

Doug, could you provide a specific example of the cryptic traceback that 
started the discussion?

--
title: Add operator.get_providing_type -> Provide an API to help debug 
super().__getattribute__ results

___
Python tracker 

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



[issue26947] Documentation improvement needed

2016-05-04 Thread Xiang Zhang

Xiang Zhang added the comment:

As a non-native speaker, actually I prefer the original one. But both versions 
lead to no confusion for me.

--

___
Python tracker 

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



[issue26961] Add operator.get_providing_type

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please provide an example of using get_providing_type? If this is 
intended primarily as a debugging aid, I think the inspect module is better 
place than the operator module. I don't know wherever this functionality is 
already provided by the inspect module.

--
nosy: +serhiy.storchaka

___
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

2016-05-04 Thread Joe Jevnik

Joe Jevnik added the comment:

people have had some time to think about this, whats should the name be so we 
can merge this?

--

___
Python tracker 

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



[issue25724] SSLv3 test failure on Ubuntu 16.04 LTS

2016-05-04 Thread Xiang Zhang

Xiang Zhang added the comment:

Ubuntu 16.04 has came out and test_ssl fails. I already opened a issue about 
it. See issue26867.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue26002] make statistics.median_grouped more efficient

2016-05-04 Thread Steven D'Aprano

Changes by Steven D'Aprano :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue26948] Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of str.partition/rpartition

2016-05-04 Thread Nick Coghlan

Nick Coghlan added the comment:

No objections from me (and I don't have anything to add to Serhiy's comments on 
the code review)

--

___
Python tracker 

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



[issue26765] Factor out common bytes and bytearray implementation

2016-05-04 Thread Meador Inge

Meador Inge added the comment:

LGTM.

--

___
Python tracker 

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



[issue26881] modulefinder should reuse the dis module

2016-05-04 Thread Meador Inge

Meador Inge added the comment:

Overall, this patch LGTM.  Some new tests would be nice.  Especially since the 
NEWS entry claims that we now support extended args.

As for for the compatibility concerns, I don't know.

--
nosy: +meador.inge

___
Python tracker 

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



[issue26961] Add operator.get_providing_type

2016-05-04 Thread Nick Coghlan

New submission from Nick Coghlan:

Prompted by a discussion with Doug Hellmann, I'd like to suggest exposing some 
of the descriptor MRO walking logic as "operator.get_providing_type".

Specifically, where "getattr(obj, 'attrname')" performs a full attribute lookup 
and "getattr(type(obj), 'attrname'), performs a type-only attribute lookup, 
"operator.get_providing_type(obj, 'attrname')" would perform an attribute 
lookup in the vein of _PyType_Lookup, but report the *type* containing the 
relevant descriptor, rather than fulling resolving the descriptor protocol.

This would be intended primarily as a debugging aid, for cases where a super() 
call is reporting an error, but it isn't clear which particular mixin class is 
failing, and the traceback isn't providing sufficient detail to figure it out 
(e.g. due to C functions in the call chain).

--
messages: 264869
nosy: doughellmann, ncoghlan
priority: normal
severity: normal
status: open
title: Add operator.get_providing_type

___
Python tracker 

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



[issue26961] Add operator.get_providing_type

2016-05-04 Thread Nick Coghlan

Changes by Nick Coghlan :


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



[issue26960] urllib hangs when closing connection

2016-05-04 Thread Chris Beaumont

Changes by Chris Beaumont :


--
keywords: +patch
Added file: http://bugs.python.org/file42728/urllib.patch

___
Python tracker 

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



[issue26960] urllib hangs when closing connection

2016-05-04 Thread Chris Beaumont

New submission from Chris Beaumont:

http://bugs.python.org/issue16270 identified an issue with 
ftpwrapper.endtransfer that causes ftp fetches to hang in certain situations. A 
fix was applied to python 3. I see the same issue on python 2.7, and the patch 
from 16270 fixes it. Is there a reason this fix hasn't been backported to 2.7?

To reproduce:

import urllib
url = "ftp://ftp.fu-berlin.de/pub/misc/movies/database/ratings.list.gz";
fp = urllib.urlopen(url)
fp.close()  # hangs

--
components: Library (Lib)
messages: 264868
nosy: Chris Beaumont, giampaolo.rodola
priority: normal
severity: normal
status: open
title: urllib hangs when closing connection
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



[issue26949] IDLE restarts when one debugs code raising SystemExit

2016-05-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks, that may make debugging this (and creating a test) easier.  I have only 
seriously used debugger with files, and often with breakpoints in the file.

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

___
Python tracker 

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



[issue26959] pickle: respect dispatch for functions again

2016-05-04 Thread Vsevolod Velichko

New submission from Vsevolod Velichko:

The commit [2] removed support for handling unpicklable functions with copyreg 
override from cpickle due to lack of the same feature in pickle.
This patch restores that feature and adds the support of it to pickle.

[1] Original discussion: 
https://mail.python.org/pipermail/python-dev/2016-May/144426.html
[2] https://hg.python.org/cpython/rev/6bd1f0a27e8e

--
components: Extension Modules
files: function_pickle.patch
keywords: patch
messages: 264866
nosy: torkve
priority: normal
severity: normal
status: open
title: pickle: respect dispatch for functions again
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42727/function_pickle.patch

___
Python tracker 

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



[issue26958] Suggestion to imporve queue.full reliability

2016-05-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The reliability issue for qsize(), empty(), and full() has nothing to do with 
their implementations.  The problem is that any information obtained by those 
methods is potentially out-of-date by the time you try to use it (the LBYL 
problem).  This is why multi-threaded programmers prefer (try: os.remove(fn) 
except OSError: pass) over (if os.path.exists(fn): os.remove(fn)) where the 
latter has an intrinsic race condition regardless of the implementation of 
os.path.exists().

One other note, self.not_full uses self.mutex internally.  There is only one 
underlying lock for the whole queue implementation.

Lastly, despite not having an underscore prefix in its name, q.not_full() is 
not part of the public API.  Your "it hangs" example is part of the reason why 
;-)

In general, don't use full and empty tests to decide whether or not to do a put 
or get.  Instead, just try the put or get directly and catch the exception if 
queue turns out to be full or empty.

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-05-04 Thread Zachary Ware

Zachary Ware added the comment:

(The version field is for the whole issue, not per patch.)

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-05-04 Thread Rohit Jamuar

Changes by Rohit Jamuar :


--
versions: +Python 2.7 -Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42726/distutils_patch_27.patch

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-05-04 Thread Rohit Jamuar

Changes by Rohit Jamuar :


--
versions: +Python 3.6 -Python 2.7
Added file: http://bugs.python.org/file42725/distutils_patch_master.patch

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-05-04 Thread Rohit Jamuar

Changes by Rohit Jamuar :


Removed file: http://bugs.python.org/file42642/msvc_respect_env_flags.patch

___
Python tracker 

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



[issue26949] IDLE restarts when one debugs code raising SystemExit

2016-05-04 Thread ppperry

ppperry added the comment:

Terry, Your `how to reproduce` is more complicated than necessary. This bug can 
be reproduced by just turning on the debugger in a python shell and typing 
`raise SystemExit` then pressing step in the debugger.

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



[issue26956] About Idle-x version not updated for 1.13

2016-05-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This is the wrong tracker for this report.  Idle-X is a 3rd party IDLE 
extension maintained elsewhere.

--
resolution:  -> third party
status: open -> closed

___
Python tracker 

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



[issue26956] About Idle-x version not updated for 1.13

2016-05-04 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage:  -> resolved

___
Python tracker 

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



[issue26949] IDLE restarts when one debugs code raising SystemExit

2016-05-04 Thread Terry J. Reedy

New submission from Terry J. Reedy:

To be more specific: if one runs a file, the shell is restarted (with the file 
name).  In the file, raise SystemExit is normally the same as running off the 
end of the file, and a prompt is printed.  If one runs a file with debugger on, 
[DEBUG ON] is printed before the prompt.  However, SystemExit while debugging 
causes a Restart Shell before the [DEBUG ON] and >>> prompt.  The 2nd restart 
does not normally happen when debugging finishes.  It does not happen when any 
other exception is raised; instead a traceback is printed as normal.

This is a minor bug, but it does prevent interactive examination of the process 
after debugging.

There is special code in run.py to catch SystemExit and not print a traceback.  
My guess in a bug in RemoteDebugger.py that causes (allows) the execution 
process to exit or otherwise get detached from the IDLE process.  When the IDLE 
process loses contact with the current execution process, it starts a new one.

--

___
Python tracker 

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



[issue26918] android: test_pipes fails

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is tr not available on Android?! I would suggest to use sed instead, but I 
afraid sed is not available too. What commands are available at all?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26893] ValueError exception raised when using IntEnum with an attribute called "name" and @unique decorator

2016-05-04 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue26957] Docs: remove duplicate "the" in description of `%z` in datetime docs

2016-05-04 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type: enhancement -> behavior
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



[issue26957] Docs: remove duplicate "the" in description of `%z` in datetime docs

2016-05-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 580ddeccd689 by Berker Peksag in branch '3.5':
Issue #26957: Remove duplicate 'the' from datetime documentation
https://hg.python.org/cpython/rev/580ddeccd689

New changeset 3a069e5593ef by Berker Peksag in branch 'default':
Issue #26957: Remove duplicate 'the' from datetime documentation
https://hg.python.org/cpython/rev/3a069e5593ef

--
nosy: +python-dev

___
Python tracker 

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



[issue26765] Factor out common bytes and bytearray implementation

2016-05-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file42724/bytes_methods_stage2.patch

___
Python tracker 

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



[issue26765] Factor out common bytes and bytearray implementation

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is the second part of the patch. It moves common code for replace() method 
to template file Objects/stringlib/transmogrify.h.

--

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2016-05-04 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Version 2 attached. Removed ro.build.version.full.

--
Added file: http://bugs.python.org/file42723/android_ver.patch

___
Python tracker 

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



[issue26918] android: test_pipes fails

2016-05-04 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The attached patch fixes this.

--
keywords: +patch
Added file: http://bugs.python.org/file42722/no_tr_skipped.patch

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2016-05-04 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 04.05.2016 21:47, Chi Hsuan Yen wrote:
> 1. Should Android 4.1 supported? If not pass_fds and logics for deriving it 
> can be removed.

According to http://www.droid-life.com/tag/distribution/ the Jelly
Bean versions (4.1, 4.2 and 4.3) still have a sizable market
share, so if it's not too much trouble, I think supporting 4.1 would
be a plus.

> 2. I can't find ro.build.version.full on any device/emulator I have access 
> to. Maybe it should be removed due to low popularity?

Agreed.

--

___
Python tracker 

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



[issue26958] Suggestion to imporve queue.full reliability

2016-05-04 Thread Sudharsan R

Sudharsan R added the comment:

Just add on to it..
q=queue.Queue()
with q.not_full:
q.put_nowait(1)

this will hang. So if we acquire the not_full while computing size, all puts 
will wait. Same is the case for q.empty() and q.not_empty method and condition 
respectively.

--

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2016-05-04 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Several questions on implementation:
1. Should Android 4.1 supported? If not pass_fds and logics for deriving it can 
be removed.
2. I can't find ro.build.version.full on any device/emulator I have access to. 
Maybe it should be removed due to low popularity?

Some related Android source codes, as my implementation basis:
1. Android 4.1's ANDROID_PROPERTY_WORKSPACE: 
https://android.googlesource.com/platform/bionic/+/android-4.1.1_r1/libc/bionic/system_properties.c#55
2. The Android Framework assumes property values to be valid UTF-8: 
https://android.googlesource.com/platform/frameworks/base/+/android-5.1.1_r37/core/jni/android_os_SystemProperties.cpp#49.
 In fact if I feed a malformed /system/build.prop to DalvikVM, it crashes [1]
3. Google's Android Compatibility Test Suite (CTS) [2] assumes `getprop` binary 
is in $PATH and can be executed: 
https://android.googlesource.com/platform/cts/+/android-5.1.1_r37/tests/tests/os/src/android/os/cts/BuildTest.java#110

[1] 
https://github.com/rave-engine/python3-android/pull/10#issuecomment-159390390
[2] https://source.android.com/compatibility/cts/

--
Added file: http://bugs.python.org/file42721/android_ver.patch

___
Python tracker 

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



[issue26958] Suggestion to imporve queue.full reliability

2016-05-04 Thread SilentGhost

Changes by SilentGhost :


--
components: +Library (Lib)
nosy: +rhettinger

___
Python tracker 

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



[issue26958] Suggestion to imporve queue.full reliability

2016-05-04 Thread Sudharsan R

New submission from Sudharsan R:

I was browsing through the code for queue.full and queue.put methods. The 
queue.full method claims it is not a reliable one. But, the same internal 
implementation - _qsize is used for put as well as full. "put" is thread safe 
and reliable and "full" is not.
Why can't the full method acquire self.not_full instead of self.mutex, which 
will make both of the methods accurate at that instance of time?

def full(self):
"""Return True if the queue is full, False otherwise (not reliable!)."""
self.mutex.acquire()
n = 0 < self.maxsize == self._qsize()
self.mutex.release()
return n
def put(self, item, block=True, timeout=None):
"""Put an item into the queue.

If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until a free slot is available. If 'timeout' is
a positive number, it blocks at most 'timeout' seconds and raises
the Full exception if no free slot was available within that time.
Otherwise ('block' is false), put an item on the queue if a free slot
is immediately available, else raise the Full exception ('timeout'
is ignored in that case).
"""
self.not_full.acquire()
try:
if self.maxsize > 0:
if not block:
if self._qsize() == self.maxsize:
raise Full

--
messages: 264851
nosy: Sudharsan R
priority: normal
severity: normal
status: open
title: Suggestion to imporve queue.full reliability
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



[issue26765] Factor out common bytes and bytearray implementation

2016-05-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 41969033eb9d by Serhiy Storchaka in branch 'default':
Issue #26765: Moved common code and docstrings for bytes and bytearray methods
https://hg.python.org/cpython/rev/41969033eb9d

--
nosy: +python-dev

___
Python tracker 

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



[issue26926] Large files are not supported on Android

2016-05-04 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Here is a patch that uses resource.setrlimit() to check whether large file may 
not be supported.

--
keywords: +patch
Added file: http://bugs.python.org/file42720/large_file.patch

___
Python tracker 

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



[issue26957] Docs: remove duplicate "the" in description of `%z` in datetime docs

2016-05-04 Thread Alex Chan

New submission from Alex Chan:

The description of the `%z` format code in the datetime docs reads:

> UTC offset in the form +HHMM or -HHMM (empty string if the the object is 
> naive).

This tiny patch removes the second "the".

The current wording goes at least as far back as Python 2.6; see 
https://docs.python.org/2.6/library/datetime.html?highlight=datetime#strftime-and-strptime-behavior.

--
assignee: docs@python
components: Documentation
files: oneword.patch
keywords: patch
messages: 264848
nosy: alexwlchan, docs@python
priority: normal
severity: normal
status: open
title: Docs: remove duplicate "the" in description of `%z` in datetime docs
type: enhancement
Added file: http://bugs.python.org/file42719/oneword.patch

___
Python tracker 

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



[issue26002] make statistics.median_grouped more efficient

2016-05-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7b2fafd78c1d by Steven D'Aprano in branch 'default':
Issue 26002 and 25974
https://hg.python.org/cpython/rev/7b2fafd78c1d

--
nosy: +python-dev

___
Python tracker 

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



[issue26811] segfault due to null pointer in tuple

2016-05-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a98ef122d73d by Serhiy Storchaka in branch '3.5':
Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL
https://hg.python.org/cpython/rev/a98ef122d73d

New changeset 3fe1c7ad3b58 by Serhiy Storchaka in branch 'default':
Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL
https://hg.python.org/cpython/rev/3fe1c7ad3b58

--
nosy: +python-dev

___
Python tracker 

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



[issue26951] Unintuitive error when using generator expression in class property

2016-05-04 Thread Mark Dickinson

Mark Dickinson added the comment:

The outer for loop in a generator expression is evaluated immediately; 
everything after that is evaluated lazily. This was a deliberate design choice: 
see https://www.python.org/dev/peps/pep-0289/#early-binding-versus-late-binding 
for some rationale. This explains why you're able to access "B". The inability 
to access "C" is due to the usual rule for Python scope resolution: class 
scopes are skipped when examining nested scopes.

The early evaluation of the outermost for is covered in the docs, here: 
https://docs.python.org/2/reference/expressions.html#generator-expressions

"""
However, the leftmost for clause is immediately evaluated, so that an error 
produced by it can be seen before any other possible error in the code that 
handles the generator expression.
"""

So this behaviour is by design, though there may be a doc issue here. Changing 
components and versions accordingly.

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python, mark.dickinson
versions: +Python 3.6 -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The problem is that format() fails for instances of some classes, because the 
type still is not initialized. The simplest example -- list iterator.

>>> format(iter([]))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Type listiterator doesn't define __format__

After forcing type initialization (for example by getting any type's 
attribute), format() becomes working.

>>> type(iter([])).foo
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: type object 'listiterator' has no attribute 'foo'
>>> format(iter([]))
''

I afraid that format() is just one example, and there are other functions or 
operators that don't work or work incorrectly if the type was not initialized.

init_types-2.7.patch adds explicit initialization of 38 types (I didn't check 
that all of them need this, but I suppose they do). This is large patch, and 
I'm not sure that it fixes all types.

Other way is to try to initialize the type just in _PyType_Lookup if it is not 
initialized. This is simple change, but a comment in _PyType_Lookup warns me. I 
found that this solution was already applied as an attempt to fix issue551412, 
but then reverted. Since you seem to be the most knowledgeable with this code, 
I'm asking you what was wrong with this approach and how we can fix this.

Python 3.x also suffers from this bug, but it is reproduced with less types. 
For example it isn't reproduced for list iterator. I don't know why.

--

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added a check for Py_TPFLAGS_READYING to prevent recursive calling.

--
Added file: http://bugs.python.org/file42718/init_type_in_pytype_lookup.patch

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file42717/init_type_in_pytype_lookup.patch

___
Python tracker 

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



[issue26945] difflib.HtmlDiff().make_file() treat few change as whole line change

2016-05-04 Thread SilentGhost

SilentGhost added the comment:

This seems to do with the percentage of affected characters, the threshold 
seems to be about a quarter. Not sure this is a bug.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue26946] os.path.realpath.__name__ is 'abspath'

2016-05-04 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue26943] datetime.datetime.strptime() raises an exception

2016-05-04 Thread Brett Cannon

Changes by Brett Cannon :


--
title: Datetime.strptime crash -> datetime.datetime.strptime() raises an 
exception

___
Python tracker 

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



[issue26696] Document collections.abc.ByteString

2016-05-04 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: docs@python -> brett.cannon

___
Python tracker 

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



[issue26956] About Idle-x version not updated for 1.13

2016-05-04 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +kbk, roger.serwy, terry.reedy
type:  -> behavior

___
Python tracker 

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



[issue26955] Implement equivalent to `pip.locations.distutils_scheme` in distutils

2016-05-04 Thread SilentGhost

Changes by SilentGhost :


--
components: +Distutils
nosy: +dstufft, eric.araujo

___
Python tracker 

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



[issue26949] IDLE restarts when one debugs code raising SystemExit

2016-05-04 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +kbk, roger.serwy, terry.reedy
stage:  -> test needed

___
Python tracker 

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



[issue26943] Datetime.strptime crash

2016-05-04 Thread SilentGhost

SilentGhost added the comment:

Jens, the issue seems to be related to the locale under which your script is 
operating. You could try to ensure that the locale is suitable for the %b 
switch. In any case this doesn't look like a datetime bug.

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue26952] argparse help formatter crashes

2016-05-04 Thread Xiang Zhang

Xiang Zhang added the comment:

I agree with Berker. Even without any exceptions, the help message given is not 
what add_argument_group and add_mutually_exclusive_group intend.

You can see

usage: argparse_test.py [-h] [--foo] -u URL -p PROJECT [--dump] --mergeInput
MERGEINPUT [--removeDisabled] -c CHECKERS

Sets the checkers of a klocwork project

optional arguments:
  -h, --helpshow this help message and exit
  --foo
  -c CHECKERS, --checkers CHECKERS
File which lists the checkers to be enabled.

There is not group name and still optional arguments. And the command line does 
not show exclusive. I believe they are not designed to work like this.

--

___
Python tracker 

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



[issue26952] argparse help formatter crashes

2016-05-04 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +bethard

___
Python tracker 

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



[issue26952] argparse help formatter crashes

2016-05-04 Thread Endre

Endre added the comment:

Hi,

Thanks for taking a look at it.
I have only tried it with argparse-1.4.0.

"I don't think add_mutually_exclusive_group and add_argument_group are designed 
to work together."

Yes, it really works strange in this case. I guess the framework should raise 
an exception which states that this use case is not supported, e.g. at the 
"serverGroup = mutexGroup.add_argument_group('serverGroup')
" line.

--

___
Python tracker 

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-04 Thread Guido van Rossum

Guido van Rossum added the comment:

Serhiy, I'm happy to help, but I'm not sure what you're asking me to do. Decide 
between different patches? I can't even repro the issue.

--

___
Python tracker 

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



[issue26956] About Idle-x version not updated for 1.13

2016-05-04 Thread Jeff Peters

New submission from Jeff Peters:

The help| about idleX | popup  still lists  the version as 1.12  this  throws 
off the check for updats functionality

--
components: IDLE
messages: 264838
nosy: Jeff Peters
priority: normal
severity: normal
status: open
title: About Idle-x  version not updated for  1.13
versions: Python 3.4

___
Python tracker 

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



[issue26955] Implement equivalent to `pip.locations.distutils_scheme` in distutils

2016-05-04 Thread Sylvain Corlay

New submission from Sylvain Corlay:

When installing a python package that has `headers`, these headers are usually 
installed under the main python include directory, which can be retrieved with 
`sysconfig.get_path('include')` or directly referred to as 'include' when 
setting the include directories of an extension module. 

However, on some systems like OS X, headers for extension modules are not 
located in under the python include directory 
(/usr/local/Cellar/pythonX/X.Y.Z/Frameworks/Python.framework/Versions/X.Y/include/pythonX.Y)
 but in `/usr/local/include/pythonX.Y`.

Is there a generic way to find the location where  headers are installed in a  
python install?

pip.locations implements `distutils_scheme` which seems to be returning the 
right thing, but it seems to be a bit overkill to require pip. On the other 
side, no path returned by sysconfig corresponds to 
`/usr/local/include/pythonX.Y`

--
messages: 264836
nosy: sylvain.corlay
priority: normal
severity: normal
status: open
title: Implement equivalent to `pip.locations.distutils_scheme` in distutils
type: enhancement
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



[issue26952] argparse help formatter crashes

2016-05-04 Thread Xiang Zhang

Xiang Zhang added the comment:

This error occurs due to there is no action belong to the mutexGroup, the code 
requires at least one. You can simply add

mutexGroup.add_argument('--foo', action='store_true')

and you'll see the error disappears. I have no idea that this behaviour is 
intended or not.

--

___
Python tracker 

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



[issue26952] argparse help formatter crashes

2016-05-04 Thread Berker Peksag

Berker Peksag added the comment:

I don't think add_mutually_exclusive_group and add_argument_group are designed 
to work together. Did this worked with argparse 1.3.0 or stdlib version of 
argparse before? I'm getting the same traceback in 2.7 and 3.4+.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-05-04 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Fixed now. I'll watch the buildbots to assure acceptance.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26954] Add Guido's rejection notice to the "with" FAQ

2016-05-04 Thread Steven D'Aprano

New submission from Steven D'Aprano:

The FAQs include a discussion of the rejected Pascal "with" statement 
(different from the Python `with`). From time to time people propose variants 
of it, such as using a leading dot to make it unambiguous.

Guido has just firmly rejected the latest such proposal. The FAQ should be 
updated to make it clear that even with a leading dot the proposal is dead, 
with a link to Guido's pronouncement.

https://mail.python.org/pipermail/python-ideas/2016-May/040070.html

--
assignee: docs@python
components: Documentation
messages: 264832
nosy: docs@python, steven.daprano
priority: normal
severity: normal
status: open
title: Add Guido's rejection notice to the "with" FAQ
versions: Python 2.7, Python 3.2, 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



[issue26951] Unintuitive error when using generator expression in class property

2016-05-04 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue26952] argparse help formatter crashes

2016-05-04 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-05-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eae59b6bf133 by Jason R. Coombs in branch '3.5':
Issue #20120: Use RawConfigParser for .pypirc parsing, removing support for 
interpolation unintentionally added with move to Python 3. Behavior no longer 
does any interpolation in .pypirc files, matching behavior in Python 2.7 and 
Setuptools 19.0.
https://hg.python.org/cpython/rev/eae59b6bf133

New changeset 89116bd505cb by Jason R. Coombs in branch 'default':
Issue #20120: Merge with 3.5
https://hg.python.org/cpython/rev/89116bd505cb

--
nosy: +python-dev

___
Python tracker 

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



[issue26951] Unintuitive error when using generator expression in class property

2016-05-04 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On snap! Nicely found! This seems to have something to do with the way 
generator expressions are run inside their own scope.

In Python 2.7, a list comprehension in a class sees the locals correctly:

py> class K:
... a = 2; x = [a+i for i in range(a)]
...
py> K.x
[2, 3]


But change the list comp to a generator expression, and the situation is 
different:


py> class K:
... a = 2; x = list(i for i in range(a))  # Okay
... b = 2; y = list(b+i for i in range(a))  # Raises
...
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in K
  File "", line 3, in 
NameError: global name 'b' is not defined


In Python 3, list comps use the same sort of temporary scope as genexprs, and 
sure enough, the list comp fails with the same error as the generator 
expression.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-05-04 Thread Jason R. Coombs

Jason R. Coombs added the comment:

I just confirmed only Python 3.5 gets bugfixes, so I'll apply this to 3.5 and 
default.

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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

An alternative way is just call PyType_Ready from _PyType_Lookup if 
type->tp_mro is NULL.

Here is a patch against 2.7 that restores the solution from issue551412, but 
returns NULL if type->tp_mro is still NULL after calling PyType_Ready. I found 
one place in tests when this is happened (CIOTest.test_IOBase_finalize in 
test_io).

--
assignee:  -> gvanrossum
nosy: +gvanrossum
Added file: http://bugs.python.org/file42717/init_type_in_pytype_lookup.patch

___
Python tracker 

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



[issue26953] Failed building wheel for greenlet

2016-05-04 Thread Berker Peksag

Berker Peksag added the comment:

Please use greenlet's issue tracker: 
https://github.com/python-greenlet/greenlet/issues You'll probably need to 
install Python headers by using your distribution's package manager.

--
nosy: +berker.peksag
resolution:  -> third party
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



[issue26953] Failed building wheel for greenlet

2016-05-04 Thread Xiang Zhang

Xiang Zhang added the comment:

Hmm, it's not suitable to report such problems here. You'd better google for 
it. At least you have to apt-get install python-dev or yum install python-devel.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue26953] Failed building wheel for greenlet

2016-05-04 Thread Marco

New submission from Marco:

I have tried to install bpython on Linux with this result

studio@linux:/usr/bin> pip install bpython
...
...
Running setup.py bdist_wheel for greenlet ... error
greenlet.h:8:20: fatal error: Python.h: No such file or directory
   #include 
  ^
  compilation terminated.
  error: command 'gcc' failed with exit status 1

How can I fix this error ?

MC

--

___
Python tracker 

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



[issue26952] argparse help formatter crashes

2016-05-04 Thread Endre

New submission from Endre:

I am using argparse-1.4.0.

For this code exception is thrown when the script is started with the -h option:
http://pastebin.com/dFF1paFA

This exception is thrown:
Traceback (most recent call last):
  File "C:\Users\ebak\Picea\tools\buildsystem\python\kw_set_checkers.py", line 
129, in 
args = parser.parse_args()
  File "C:\Python27\lib\argparse.py", line 1688, in parse_args
args, argv = self.parse_known_args(args, namespace)
  File "C:\Python27\lib\argparse.py", line 1720, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
  File "C:\Python27\lib\argparse.py", line 1926, in _parse_known_args
start_index = consume_optional(start_index)
  File "C:\Python27\lib\argparse.py", line 1866, in consume_optional
take_action(action, args, option_string)
  File "C:\Python27\lib\argparse.py", line 1794, in take_action
action(self, namespace, argument_values, option_string)
  File "C:\Python27\lib\argparse.py", line 994, in __call__
parser.print_help()
  File "C:\Python27\lib\argparse.py", line 2327, in print_help
self._print_message(self.format_help(), file)
  File "C:\Python27\lib\argparse.py", line 2301, in format_help
return formatter.format_help()
  File "C:\Python27\lib\argparse.py", line 279, in format_help
help = self._root_section.format_help()
  File "C:\Python27\lib\argparse.py", line 209, in format_help
func(*args)
  File "C:\Python27\lib\argparse.py", line 317, in _format_usage
action_usage = format(optionals + positionals, groups)
  File "C:\Python27\lib\argparse.py", line 388, in _format_actions_usage
start = actions.index(group._group_actions[0])
IndexError: list index out of range

--
components: Library (Lib)
messages: 264823
nosy: Endre
priority: normal
severity: normal
status: open
title: argparse help formatter crashes
type: crash
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



[issue26924] android: test_concurrent_futures fails

2016-05-04 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Patch tested, it does not fix the problem.
This is because in pyconfig.h:
/* Define to 1 if you have the `sem_unlink' function. */
#define HAVE_SEM_UNLINK 1

Android declares the function but does not implement it. This is not the only 
case, for example issue #26857.

--

___
Python tracker 

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



[issue26953] Failed building wheel for greenlet

2016-05-04 Thread Marco

Changes by Marco :


--
components: Installation
nosy: marcoconte_008
priority: normal
severity: normal
status: open
title: Failed building wheel for greenlet
versions: Python 3.4

___
Python tracker 

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



[issue26947] Documentation improvement needed

2016-05-04 Thread Eric V. Smith

Eric V. Smith added the comment:

I'm a native speaker, and it's not the greatest sentence. How about:

All of Python’s immutable built-in objects (such as numbers, strings and 
tuples) are hashable. None of its mutable containers (such as lists or 
dictionaries) are hashable.

--
nosy: +eric.smith

___
Python tracker 

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



[issue26951] Unintuitive error when using generator expression in class property

2016-05-04 Thread Emanuel Barry

Emanuel Barry added the comment:

Using a simple metaclass shows that definition order is not at fault here:

>>> class PrintOrder(dict):
...   def __setitem__(self, item, value):
... print(item, value)
... super().__setitem__(item, value)
...
>>> class Show(type):
...   def __prepare__(name, bases): return PrintOrder()
...
>>> class A(metaclass=Show):
...   B = range(10)
...   C = frozenset([4, 5, 6])
...   D = list(i for i in B)
...   E = list(i for i in B if i in C)
...
__module__ __main__
__qualname__ A
B range(0, 10)
C frozenset({4, 5, 6})
D [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in A
  File "", line 5, in 
NameError: name 'C' is not defined

However, the following works:

>>> def local_definition():
...   F = frozenset([4, 5, 6])
...   class A(metaclass=Show):
... B = range(10)
... C = frozenset([4, 5, 6])
... D = list(i for i in B)
... E = list(i for i in B if i in F)
...   return A
...
>>> local_definition()
__module__ __main__
__qualname__ local_definition..A
B range(0, 10)
C frozenset({4, 5, 6})
D [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
E [4, 5, 6]
.A'>

Sounds like either an inconsistency between 'for' and 'if' parts of generator 
expressions, or something weird about the way generator expressions work that 
I'm unaware of.

Furthermore, this isn't documented in the tutorial, the functional programming 
How-To, the 2.4 release notes or the PEP 289:

https://docs.python.org/3/tutorial/classes.html#generator-expressions
https://docs.python.org/3/howto/functional.html#generator-expressions-and-list-comprehensions
https://docs.python.org/3/whatsnew/2.4.html#pep-289-generator-expressions
https://www.python.org/dev/peps/pep-0289/

--
nosy: +ebarry
stage:  -> needs patch

___
Python tracker 

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



[issue26947] Documentation improvement needed

2016-05-04 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Xiang Zhang is correct: the original is technically correct. If you read it 
like this:

"All of Python’s immutable built-in objects are hashable, while no mutable 
containers (such as lists or dictionaries) are [hashable]."

it should be clear. But if you have a suggestion for wording which is easier to 
understand (especially for those whose English is not so good) please say so.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue26951] Unintuitive error when using generator expression in class property

2016-05-04 Thread Corey Farwell

New submission from Corey Farwell:

```
class A:
B = range(10)
C = frozenset([4, 5, 6])
D = list(i for i in B)
E = list(i for i in B if i in C)
```

```

coreyf@frewbook-pro /tmp [1]> python3 a.py
Traceback (most recent call last):
  File "a.py", line 1, in 
class A:
  File "a.py", line 5, in A
E = list(i for i in B if i in C)
  File "a.py", line 5, in 
E = list(i for i in B if i in C)
NameError: name 'C' is not defined
```

Why should I be able to access B but not C?

--
components: Interpreter Core
messages: 264819
nosy: corey
priority: normal
severity: normal
status: open
title: Unintuitive error when using generator expression in class property
type: behavior
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



[issue26950] Typo in unittest.mock > Autospeccing documentation

2016-05-04 Thread Joni Bekenstein

Joni Bekenstein added the comment:

My bad, didn't see the notice! Makes sense though. Sorry for opening an issue.

--

___
Python tracker 

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



[issue26950] Typo in unittest.mock > Autospeccing documentation

2016-05-04 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report, but the typos are intentional. Quoting from the 
documentation:

[...] if you misspell one of these assert methods then your assertion is 
gone:

>>> mock = Mock(name='Thing', return_value=None)
>>> mock(1, 2, 3)
>>> mock.assret_called_once_with(4, 5, 6)

Your tests can pass silently and incorrectly because of the typo.

--
nosy: +berker.peksag
resolution:  -> not a bug
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



[issue26906] format(object.__reduce__) fails intermittently

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

A number of other types are not initialized until you request an attribute.

Here is larger patch for 2.7 that makes 38 types to be explicitly initialized.

--
Added file: http://bugs.python.org/file42716/init_types-2.7.patch

___
Python tracker 

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



[issue26950] Typo in unittest.mock > Autospeccing documentation

2016-05-04 Thread Joni Bekenstein

New submission from Joni Bekenstein:

In several code examples from unittest.mock > Autospeccing documentation you 
will find "assret_called_with" instead of "assert_called_with".

--
assignee: docs@python
components: Documentation
messages: 264815
nosy: Joni Bekenstein, docs@python
priority: normal
severity: normal
status: open
title: Typo in unittest.mock > Autospeccing documentation
type: enhancement

___
Python tracker 

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



[issue26948] Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of str.partition/rpartition

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM, but I left a couple of minor suggestions on Rietveld. I hope they can 
make the code yet cleaner.

--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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



[issue26947] Documentation improvement needed

2016-05-04 Thread Xiang Zhang

Xiang Zhang added the comment:

I think the original is OK. Adding "not" means the opposite.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue26860] Make os.walk and os.fwalk yield namedtuple instead of tuple

2016-05-04 Thread ppperry

Changes by ppperry :


--
title: os.walk and os.fwalk yield namedtuple instead of tuple -> Make os.walk 
and os.fwalk yield namedtuple instead of tuple

___
Python tracker 

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



[issue26946] os.path.realpath.__name__ is 'abspath'

2016-05-04 Thread Berker Peksag

Berker Peksag added the comment:

It's because realpath is defined as

# realpath is a no-op on systems without islink support
realpath = abspath

under Windows.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue23275] Can assign [] = (), but not () = []

2016-05-04 Thread Berker Peksag

Berker Peksag added the comment:

Here is an updated patch. I moved the test into test_unpack and added 
additional tests. sequence -> iterable changes should probably be applied to 
3.5 as well.

Thanks for the review, Martin.

--
type: behavior -> enhancement
Added file: http://bugs.python.org/file42715/issue23275_v3.diff

___
Python tracker 

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



[issue23228] The tarfile module crashes when tarfile contains a symlink and unpack directory contain it too

2016-05-04 Thread ppperry

Changes by ppperry :


--
title: Crashes when tarfile contains a symlink and unpack directory contain it 
too -> The tarfile module crashes when tarfile contains a symlink and unpack 
directory contain it too

___
Python tracker 

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



[issue26946] os.path.realpath.__name__ is 'abspath'

2016-05-04 Thread ppperry

ppperry added the comment:

Also is true on python 3.4. Why does this matter anyway?

--
nosy: +ppperry
versions: +Python 3.4

___
Python tracker 

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



[issue26949] IDLE restarts when one debugs code raising SystemExit

2016-05-04 Thread ppperry

Changes by ppperry :


--
components: IDLE
nosy: ppperry
priority: normal
severity: normal
status: open
title: IDLE restarts when one debugs code raising SystemExit
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue26948] Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of str.partition/rpartition

2016-05-04 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch simplifies PyImport_ImportModuleLevelObject to avoid the 
temporary tuple created by str.partition/rpartition(). I don't expect any 
difference on the performance, it's more to cleanup the code.

--
files: import.patch
keywords: patch
messages: 264809
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of 
str.partition/rpartition
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file42714/import.patch

___
Python tracker 

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



[issue23228] Crashes when tarfile contains a symlink and unpack directory contain it too

2016-05-04 Thread Michael Vogt

Michael Vogt added the comment:

Anything I can do to help moving this issue forward?

--

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-05-04 Thread Michael Felt

Michael Felt added the comment:

implements ctypes.aixutil.find_library()
In a separate file as both __init__.py as util.py needs it's logic.

--
Added file: http://bugs.python.org/file42713/aixutil.py

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-05-04 Thread Michael Felt

Michael Felt added the comment:

reworked patch. To assist port to Python3 that changes in __init__.py and 
util.py are minimal. There is a new file: aixutil.py

I have only tested on Python-2.7, so there may be issues for Python3. My goal 
is to have a single file for both versions.

The main change in util.py is lots of specific (behavior) tests that I have 
encountered (and initially failed) from projects using ctypes.cdll.

I feel confident that this will work "ASIS" with nearly all existing projects.

Note: normal return is not a full path name. A full path name is only returned 
when an archive + member could not be found, but a file with the name requested 
could be found. This "fullpath" is to be compatible with existing code 
'demanding' unpacked archives.

--
Added file: http://bugs.python.org/file42712/python.Lib.ctypes.160504.patch

___
Python tracker 

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



  1   2   >