[issue26359] CPython build options for out-of-the box performance

2016-04-14 Thread Gregory P. Smith

Gregory P. Smith added the comment:

--with-optimizations seems fine.

As does having the final thing the Makefile prints out when run from a 
configuration that did not specify any of --with-pgo, --with-lto, 
--with-pydebug, or --with-optimizations be to echo message reminding people to 
configure --with-optimizations when making a release build.

The default "./configure && make" target needs to remain optimized for CPython 
developer speed.  Not release builds.

--

___
Python tracker 

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



[issue26535] Minor typo in the docs for struct.unpack

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

Indeed, let me try again

--
Added file: http://bugs.python.org/file42462/struct-size.v2.patch

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2016-04-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

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



[issue26535] Minor typo in the docs for struct.unpack

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Seems you forgot to send a patch.

--

___
Python tracker 

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



[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

This code mirrors code in the Get function, but that function inspects 
tp_descr_get (not set) instead. As I understand it, this is the difference 
between “data” descriptors and “non-data” descriptors. So I think the change is 
okay.

--
nosy: +martin.panter
stage:  -> patch review

___
Python tracker 

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



[issue26757] test_urllib2net.test_http_basic() timeout after 15 min on

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

By “mock the query”, do you mean swap out the socket for a pretend socket 
object? Another option would be to connect to a server on localhost running on 
the background, like I did for the fileno() problem.

Looks like this test_http_basic() was intended to verify that no timeout was 
being used by default.

--

___
Python tracker 

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



[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

Opened Issue 26762 about the leftover processes.

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



[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

I also tweaked the PyUnicode_FromEncodedObject() documentation to avoid the 
word “coerce” and to fix up outdated stuff.

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



[issue26535] Minor typo in the docs for struct.unpack

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

Here is a new patch:

* Use “The buffer’s size in bytes” wording
* Avoid brackets inside brackets
* Fix the three unpack functions and corresponding methods
* Also fix doc strings

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue26761] winsound module very unstable in Windows 10

2016-04-14 Thread Zachary Ware

Zachary Ware added the comment:

Glad I could guide you to a solution :)

--
stage:  -> resolved

___
Python tracker 

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



[issue26761] winsound module very unstable in Windows 10

2016-04-14 Thread Ganning Liu

Ganning Liu added the comment:

Thanks Zachary, it's not a bug!

--
status: pending -> closed

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2016-04-14 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +davin

___
Python tracker 

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



[issue26762] test_multiprocessing_spawn leaves processes running in background

2016-04-14 Thread Martin Panter

New submission from Martin Panter:

I noticed that this test leaves processes running in the background for a 
moment after the parent Python process exits. They disappear pretty quickly, 
but even so, it seems like a bad design. However I am not familiar with the 
multiprocessing module, so maybe this is unavoidable.

$ ps
  PID TTY  TIME CMD
  597 pts/200:00:01 bash
13423 pts/200:00:00 ps
$ python3.5 -m test test_multiprocessing_spawn; ps
[1/1] test_multiprocessing_spawn
1 test OK.
  PID TTY  TIME CMD
  597 pts/200:00:01 bash
13429 pts/200:00:00 python3.5
13475 pts/200:00:00 python3.5
15066 pts/200:00:00 ps

--
components: Tests
messages: 263442
nosy: martin.panter
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn leaves processes running in background
type: 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



[issue26753] Obmalloc lock LOCK_INIT and LOCK_FINI are never used

2016-04-14 Thread Tim Peters

Tim Peters added the comment:

Right, these macros were in the original module (by Vladimir Marangozov).  
They've never done anything - never been tested.  Over the years I removed 
other layers of macro indirection (while other people added more ;-) ), but 
left these alone because they point out at least some speed-crucial places 
where "removing the GIL" would add new costs.

That said, I wouldn't object if you removed all the lock-related macros in 
obmalloc.  The code is hairier now than it was at the start, so throwing out 
unused cruft is also more valuable now than it was at the start.

--
nosy: +tim.peters

___
Python tracker 

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



[issue19985] Not so correct error message when initializing Struct with ill argument

2016-04-14 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +Document whether it's safe to use bytes for struct format string 
-Not so correct error message when initializing Struct with ill argument

___
Python tracker 

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



[issue26761] winsound module very unstable in Windows 10

2016-04-14 Thread Zachary Ware

Zachary Ware added the comment:

This looks very like a case of shadowing a standard library module.  Just 
before your call to Beep(), try "print(winsound.__file__)".  If it's not 
"C:\SomePathToPython\DLLs\winsound.pyd" (with an appropriate real path in place 
of "SomePathToPython"), it's the path of the file that you should rename to 
something other than "winsound.py".

--
nosy: +zach.ware
resolution:  -> not a bug
status: open -> pending
type: compile error -> behavior

___
Python tracker 

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



[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af655e73f7bd by Martin Panter in branch '3.5':
Issue #15984: Correct PyUnicode_FromObject() and _FromEncodedObject() docs
https://hg.python.org/cpython/rev/af655e73f7bd

New changeset 570ada02d0f0 by Martin Panter in branch 'default':
Issue #15984: Merge PyUnicode doc from 3.5
https://hg.python.org/cpython/rev/570ada02d0f0

--
nosy: +python-dev

___
Python tracker 

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



[issue26761] winsound module very unstable in Windows 10

2016-04-14 Thread Ganning Liu

New submission from Ganning Liu:

Cannot using winsound.Beep() in .py file (run as module), get error information 
like:

Traceback (most recent call last):
  File "C:\Users\liuga\Desktop\sound.py", line 2, in 
winsound.Beep(230,200)
AttributeError: module 'winsound' has no attribute 'Beep'

And also failed in interactive shell occasionally.

--
components: Extension Modules
messages: 263438
nosy: Ganning Liu
priority: normal
severity: normal
status: open
title: winsound module very unstable in Windows 10
type: compile error
versions: Python 2.7, Python 3.5

___
Python tracker 

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



[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

If a user calls makefile(bufsize=0), they may have written that based on Python 
2’s behaviour of always doing full writes. But in Python 3 this is indirectly 
documented as doing partial writes: makefile() args interpreted as for open, 
and open() buffering disabled returns a RawIOBase subclass.

People porting code from Python 2 may be unprepared for partial writes. Just 
another subtle Python 2 vs 3 incompatibility. People using only Python 3 might 
be unprepared if they are not familar with the intricacies of the Python API, 
but then why are they using bufsize=0? On the other hand, they might require 
partial writes if they are using select() or similar, so changing it would be a 
compatibility problem.

You could use the same arguments for socketserver. The difference is that wfile 
being in raw mode is not documented. Almost all of the relevant builtin library 
code that I reviewed expects full blocking writes, and I did not find any that 
requires partial writes. So I think making the change in socketserver is less 
likely to introduce compatibility problems, and is much more beneficial.

--

___
Python tracker 

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



[issue19985] Not so correct error message when initializing Struct with ill argument

2016-04-14 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +Not so correct error message when initializing Struct with ill 
argument

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

@stinner, my host doesn't have internet connection and it doesn't have gcc 
installed.

I don't know how to install gcc in windriverlinux.
In famous linux distributions like ubuntu and centos, i install gcc using 'yum 
install gcc' or 'apt-get install gcc' commands.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

Couple more outputs:


/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
   significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
#  define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
#  define WORDS_BIGENDIAN 1
# endif
#endif


Math works in some cases.

>>> import math
>>> math.sqrt(2)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: math domain error
>>> math.floor(2.5)
2.0
>>>



Also, could you please let me know the train of thought and ask for all the 
outputs as much as possible in one go? because I feel like I am delaying your 
debugging.

--

___
Python tracker 

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



[issue26638] Avoid warnings about missing CLI options when building documentation

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

I’m not an expert on Sphinx. Maybe 
 
could help with disabling these warnings. Considering there are so many false 
positives, it might be best to disable the warning. Though my patch does have a 
few genuine improvements as well.

I already used the :option:`-Wd <-W>` syntax in some cases; see 
Doc/library/warnings.rst for example. The problem in unittest.rst is I think 
Sphinx is trying to find a -W option defined within unittest.rst (with the 
unittest --buffer etc options), rather than the main Python options from 
using/cmdline.rst.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

Here is one output:

root@fpc0:~# grep IEEE /usr/include/python2.7/pyconfig-32.h
/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
/* #undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 */
/* #undef HAVE_IEEEFP_H */
/* #undef HAVE_LIBIEEE */
/* Define to activate features from IEEE Stds 1003.1-2001 */
root@fpc0:~#

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

I guess that Serhiy is looking for these variables defined in pyconfig.h:
---
/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
   mixed-endian order (byte order 45670123) */
#undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754

/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
   significant byte first */
#undef DOUBLE_IS_BIG_ENDIAN_IEEE754

/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
   least significant byte first */
#undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
---

On Fedora, pyconfig.h is installed into /usr/include/python2.7/pyconfig.h. This 
file doesn't contain any sensitive information, it is the configuration used to 
build Python.

On Fedora, this file only dispatches between pyconfig-32.h and pyconfig-64.h:
---
$ cat /usr/include/python2.7/pyconfig.h 
#include 

#if __WORDSIZE == 32
#include "pyconfig-32.h"
#elif __WORDSIZE == 64
#include "pyconfig-64.h"
#else
#error "Unknown word size"
#endif
---

My system is 64-bit, so I can use pyconfig-64.h:
---
$ grep IEEE /usr/include/python2.7/pyconfig-64.h 
/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
/* #undef HAVE_IEEEFP_H */
/* #undef HAVE_LIBIEEE */
/* Define to activate features from IEEE Stds 1003.1-2001 */
---

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

The keys ENDIAN and IEEE are not available.

--

___
Python tracker 

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



[issue26748] enum.Enum is False-y

2016-04-14 Thread Ethan Furman

Ethan Furman added the comment:

Enum classes are now Truth-y in 3.4, 3.5, enum34, and aenum.  :)

--
assignee:  -> ethan.furman
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fields with ENDIAN or IEEE in key.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

Hi, This is my work system and I don't know if I am allowed to send out the 
complete output of "print sysconfig.get_config_vars()". could you please let me 
know which fields you are looking for?

--

___
Python tracker 

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



[issue26755] Update version{added,changed} docs in devguide

2016-04-14 Thread Georg Brandl

Georg Brandl added the comment:

Now that "added" doesn't mention the second argument, the "This one *must* have 
the second argument (explanation of the change)." should be changed. Otherwise 
+1.

--

___
Python tracker 

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



[issue26759] PyBytes_FromObject accepts arbitrary iterable

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Other *_FromObject public API functions:

PyUnicode_FromObject() -- Very strict. Accepts only str subclasses.
PyByteArray_FromObject() -- Very lenient! Calls the bytearray() constructor, 
accepts even an integer!
PyMemoryView_FromObject() -- No surprises. Accepts only objects that support 
the buffer protocol.

--

___
Python tracker 

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



[issue26759] PyBytes_FromObject accepts arbitrary iterable

2016-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Note that there is alternative API function PyObject_Bytes(), that accepts 
> same arguments as the bytes() constructor, except an integer, and supports 
> the buffer protocol, the iterable protocol, and in additional supports the 
> __bytes__() special method.

That's a good point. Then I think PyBytes_FromObject() should be restricted. 
Also the docs for these functions should probably mention each other.

--

___
Python tracker 

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



[issue26760] Document PyFrameObject

2016-04-14 Thread Brett Cannon

New submission from Brett Cannon:

Can be as simple as https://docs.python.org/3/c-api/code.html#c.PyCodeObject . 
Key point is to have it in the index so people don't wonder what the deal is 
with the type when noticing it as a parameter to a function.

--
assignee: brett.cannon
components: Documentation
messages: 263424
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Document PyFrameObject
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



[issue26759] PyBytes_FromObject accepts arbitrary iterable

2016-04-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

PyBytes_FromObject creates a bytes object from an object that implements the 
buffer or the iterable protocol. But only using the buffer protocol is 
documented.

We should either document the current behavior (the documentation of 
int.from_bytes() can be used as a sample), or change the behavior to match the 
documentation.

For now PyBytes_FromObject() is used in the stdlib only for converting FS paths 
to str (besides using internally in bytes). When called from 
PyUnicode_FSDecoder(), this leads to accepting arbitrary iterables as 
filenames, that looks at leas strange (issue26754). In the posix module it is 
called only for objects that support the buffer protocol.

Thus the support of the iterable protocol is not used or misused in the stdlib. 
I don't know if it is used correctly in third party code, I suspect that this 
is rather misused. Note that there is alternative API function 
PyObject_Bytes(), that accepts same arguments as the bytes() constructor, 
except an integer, and supports the buffer protocol, the iterable protocol, and 
in additional supports the __bytes__() special method.

--
messages: 263423
nosy: haypo, martin.panter, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: PyBytes_FromObject accepts arbitrary iterable
type: 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



[issue26756] fileinput handling of unicode errors from standard input

2016-04-14 Thread Joel Barry

Joel Barry added the comment:

I was suggesting that the openhook could somehow be applied to a
*reopening* of sys.stdin.  Something like this:

326c326,329
< self._file = sys.stdin
---
> if self._openhook:
> self._file = self._openhook(self._filename, 
> self._mode)
> else:
> self._file = sys.stdin

But this won't work because self._filename here is '' which
isn't a real filename.  In conjunction with a change to my hook:

   def hook(filename, mode):
   if filename == '':
   return io.TextIOWrapper(sys.stdin.buffer, errors='replace')
   return open(filename, mode, errors='replace')

things would work, but this is a bit awkward.

This works for me without changing my hook:

326c326,329
< self._file = sys.stdin
---
> if self._openhook:
> self._file = self._openhook('/dev/stdin', self._mode)
> else:
> self._file = sys.stdin

but I realize that using /dev/stdin is not portable.

The desired outcome is really just to control Unicode behavior from
stdin, not necessary the ability to provide a generic hook.  Adding an
'errors' keyword to apply to stdin would solve my case, but if you
open up 'errors', someone may also want 'encoding', and the others,
which is why it would be nicer if this could somehow be solved with
the existing openhook interface.

--

___
Python tracker 

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



[issue26756] fileinput handling of unicode errors from standard input

2016-04-14 Thread SilentGhost

SilentGhost added the comment:

While documentation seems not entirely clear, the openhook only applies to 
files.

I'm not sure what is the logic behind the suggested change, what would openhook 
do in your situation?

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



[issue26758] Unnecessary format string handling for no argument slot wrappers in typeobject.c

2016-04-14 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +serhiy.storchaka
type:  -> behavior

___
Python tracker 

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



[issue25942] subprocess.call SIGKILLs too liberally

2016-04-14 Thread Mike Pomraning

Mike Pomraning added the comment:

#2 and #4 are the only predictable and palatable options, I think.  Ignore the 
patch that started this issue.

--

___
Python tracker 

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



[issue26758] Unnecessary format string handling for no argument slot wrappers in typeobject.c

2016-04-14 Thread Josh Rosenberg

New submission from Josh Rosenberg:

Right now, in typeobject.c, the call_method and call_maybe utility functions 
have a fast path for no argument methods, where a NULL or "" format string just 
calls PyTuple_New(0) directly instead of wasting time parsing Py_VaBuildValue.

Problem is, nothing uses it. Every no arg user (the slot wrappers for __len__, 
__index__ and __next__ directly, and indirectly through the SLOT0 macro for 
__neg__, __pos__, __abs__, __invert__, __int__ and __float__) is passing along 
"()" as the format string, which fails the test for NULL/"", so it calls 
Py_VaBuildValue that goes to an awful lot of trouble to scan the string a few 
times and eventually spit out the empty tuple anyway.

Changing the three direct calls to call_method where it passes "()" as the 
format string, as well as the definition of SLOT0, to replace "()" with NULL as 
the format string argument should remove a non-trivial number of C varargs 
function calls and string processing, replacing it with a single, cheap 
PyTuple_New(0) call (which Py_VaBuildValue was already eventually performing 
anyway). If I understand the purpose of these slot wrapper functions, that 
should give a free speed up to all types implemented at the Python level, 
particularly numeric types (e.g. fractions.Fraction) and container/iterator 
types (speeding up __len__ and __next__ respectively).

I identified this while on a work machine which I can't use to check out the 
Python repository; I'll submit a patch later today if no one else gets to it, 
once I'm home and can use my own computer to make/test the fix.

--
components: Interpreter Core
messages: 263419
nosy: josh.r
priority: normal
severity: normal
status: open
title: Unnecessary format string handling for no argument slot wrappers in 
typeobject.c
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



[issue26706] Update OpenSSL version in readme

2016-04-14 Thread Zachary Ware

Zachary Ware added the comment:

Thanks, Shaun!

--

___
Python tracker 

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



[issue26465] Upgrade OpenSSL shipped with python installers

2016-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3a3b30c310e5 by Zachary Ware in branch '2.7':
Issue #26465: Update VS9.0 build files for OpenSSL 1.0.2g
https://hg.python.org/cpython/rev/3a3b30c310e5

--

___
Python tracker 

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



[issue26706] Update OpenSSL version in readme

2016-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4936b2723471 by Zachary Ware in branch '3.5':
Issue #26706: Update OpenSSL version in PCbuild/readme.txt
https://hg.python.org/cpython/rev/4936b2723471

New changeset 430f5a23a853 by Zachary Ware in branch 'default':
Closes #26706: Merge with 3.5
https://hg.python.org/cpython/rev/430f5a23a853

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



[issue26359] CPython build options for out-of-the box performance

2016-04-14 Thread Brett Cannon

Brett Cannon added the comment:

What if we added a --with-optimizations flag to build --with-pgo, --with-lto, 
and avoid having to run `make` twice thanks to `make`/`make profileopt`? That 
way the default build is still quick and reasonable but gain a simple way to 
use the right flags and avoid having to remember to run `make` twice?

--

___
Python tracker 

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



[issue26058] PEP 509: Add ma_version to PyDictObject

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

The implementation is outdated: ma_version was renamed to ma_version_tag in the 
latest version of the PEP 509.

--

___
Python tracker 

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



[issue26757] test_urllib2net.test_http_basic() timeout after 15 min on

2016-04-14 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +florin.papa, zach.ware

___
Python tracker 

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



[issue26757] test_urllib2net.test_http_basic() timeout after 15 min on

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

It looks deliberate to test the HTTP query with *no* timeout. Sadly, it looks 
like it's ok that an HTTP query takes longer than 15 minutes!

Can't we mock the query to only test that the socket timeout is None? Move the 
test from test_urllib2net to test_urllib2.

class TimeoutTest(unittest.TestCase):
def test_http_basic(self):
self.assertIsNone(socket.getdefaulttimeout())
url = "http://www.example.com";
with support.transient_internet(url, timeout=None):
u = _urlopen_with_retry(url)
self.addCleanup(u.close)
self.assertIsNone(u.fp.raw._sock.gettimeout())

--

___
Python tracker 

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



[issue26757] test_urllib2net.test_http_basic() timeout after 15 min on

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #21069 "test_fileno of test_urllibnet intermittently fails".

--

___
Python tracker 

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



[issue26757] test_urllib2net.test_http_basic() timeout after 15 min on

2016-04-14 Thread STINNER Victor

New submission from STINNER Victor:

Timeout seen on "x86-64 Ubuntu 15.10 Skylake CPU 3.5" buildbot:

http://buildbot.python.org/all/builders/x86-64%20Ubuntu%2015.10%20Skylake%20CPU%203.5/builds/357/steps/test/logs/stdio

[215/398] test_urllib2net
Timeout (0:15:00)!
Thread 0x7f71354be700 (most recent call first):
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/socket.py", 
line 575 in readinto
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/http/client.py", 
line 258 in _read_status
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/http/client.py", 
line 297 in begin
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/http/client.py", 
line 1197 in getresponse
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py",
 line 1246 in do_open
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py",
 line 1271 in http_open
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py",
 line 443 in _call_chain
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py",
 line 483 in _open
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py",
 line 465 in open
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py",
 line 162 in urlopen
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/test_urllib2net.py",
 line 19 in _retry_thrice
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/test_urllib2net.py",
 line 27 in wrapped
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/test_urllib2net.py",
 line 255 in test_http_basic
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/case.py", 
line 600 in run
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/case.py", 
line 648 in __call__
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/runner.py",
 line 176 in run
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/support/__init__.py",
 line 1800 in _run_suite
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/support/__init__.py",
 line 1834 in run_unittest
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", 
line 1305 in test_runner
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", 
line 1306 in runtest_inner
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", 
line 991 in runtest
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", 
line 784 in main
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", 
line 1592 in main_in_temp_cwd
  File 
"/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/__main__.py", 
line 3 in 
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/runpy.py", 
line 85 in _run_code
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/runpy.py", 
line 184 in _run_module_as_main

--
messages: 263411
nosy: haypo, martin.panter
priority: normal
severity: normal
status: open
title: test_urllib2net.test_http_basic() timeout after 15 min on

___
Python tracker 

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



[issue24165] Free list for single-digits ints

2016-04-14 Thread Larry Hastings

Larry Hastings added the comment:

FWIW, the patch still cleanly applies, but now a couple tests in posix fail 
because the assertion text has changed.

--

___
Python tracker 

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



[issue26756] fileinput handling of unicode errors from standard input

2016-04-14 Thread Joel Barry

New submission from Joel Barry:

The openhook for fileinput currently will not be called when the input
is from sys.stdin.  However, if the input contains invalid UTF-8
sequences, a program with a hook that specifies errors='replace' will
not behave as expected:

  $ cat x.py
  import fileinput
  import sys
  
  def hook(filename, mode):
  print('hook called')
  return open(filename, mode, errors='replace')
  
  for line in fileinput.input(openhook=hook):
  sys.stdout.write(line)


  $ echo -e "foo\x80bar" >in.txt

  $ python3 x.py in.txt
  hook called
  foo�bar

Good.  Hook is called, and replacement character is observed.

  $ python3 x.py 
  for line in fileinput.input(openhook=hook):
File 
"/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/fileinput.py",
 line 263, in __next__
  line = self.readline()
File 
"/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/fileinput.py",
 line 363, in readline
  self._buffer = self._file.readlines(self._bufsize)
File 
"/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/codecs.py",
 line 319, in decode
  (result, consumed) = self._buffer_decode(data, self.errors, final)
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3: 
invalid start byte

Hook was not called, and so we get the UnicodeDecodeError.

Should fileinput attempt to apply the hook code to stdin?

--
messages: 263409
nosy: jmb236
priority: normal
severity: normal
status: open
title: fileinput handling of unicode errors from standard input
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



[issue26359] CPython build options for out-of-the box performance

2016-04-14 Thread Steve Dower

Steve Dower added the comment:

FWIW, I'm also against enabling it by default due to the extended build time. 
There are plenty of reasons to build Python with the non-debug ABI that don't 
require extended optimizations. Production builds are the exception I believe, 
not the rule.

--

___
Python tracker 

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



[issue26749] Update devguide to include Fedora's DNF

2016-04-14 Thread Luiz Poleto

Luiz Poleto added the comment:

Nice! Thanks!

On Thu, Apr 14, 2016, 5:16 AM Berker Peksag  wrote:

>
> Berker Peksag added the comment:
>
> Committed in 0ed2497e5aa4. Thanks for the patch, Luiz.
>
> --
> components: +Devguide -Documentation
> nosy: +berker.peksag, ezio.melotti, willingc
> resolution:  -> fixed
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1)

2016-04-14 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



[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

Since the initial issue is fixed (test failures when using -Werror), I suggest 
to close this issue.

> BTW the spurious background processes are still there (visible if you run 
> “ps” or “pstree” immediately after the test finishes), but they no longer 
> print errors.

Please open a new issue for that.

--

___
Python tracker 

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



[issue26638] Avoid warnings about missing CLI options when building documentation

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

> FTR the warnings that I am fixing were apparently enabled in Sphinx 1.3.4, 
> reverted in 1.3.6, and added in 1.4.

Would it be possible to turn off the warning?

Doc/using/cmdline.py uses ".. cmdoption::". If we cannot turn off the warning 
on option, maybe we should use a new :cmdoption:`xxx` which wouldn't emit a 
warning?

I'm not strongly opposed to doc-warnings.patch.

I understand that Sphinx expects the exact option, for example -W, whereas the 
doc uses option with parameter like -Wd. Sphinx is unable to link to the option.

Maybe we need something like :cmdoption:`-Wd <-W>`: display -Wd but link to -W?

--
nosy: +haypo

___
Python tracker 

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



[issue26747] types.InstanceType only for old style class only in 2.7

2016-04-14 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

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



[issue26747] types.InstanceType only for old style class only in 2.7

2016-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b684298671f9 by Berker Peksag in branch '2.7':
Issue #26747: Document that InstanceTypes only works for old-style classes
https://hg.python.org/cpython/rev/b684298671f9

--
nosy: +python-dev

___
Python tracker 

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



[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

> I recall a "write1" function which was well defined: limited to 1 syscall, 
> don't try (or maybe only on the very specific case of EINTR). But I'm not 
> sure that it still exists in the io module of Python 3.

Oops, in fact it is read1:
https://docs.python.org/dev/library/io.html#io.BufferedIOBase.read1
"Read and return up to size bytes, with at most one call to the underlying raw 
stream’s read()"

--

___
Python tracker 

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



[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

FYI I recently worked on a issue with partial write in eventlet on Python 3:
* https://github.com/eventlet/eventlet/issues/274
* https://github.com/eventlet/eventlet/issues/295

By the way, I opened #26292 "Raw I/O writelines() broken for non-blocking I/O" 
as a follow-up of the eventlet issue.

--

___
Python tracker 

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



[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

Hum, since long time ago, Python has issues with partial write. It's hard to 
guess if a write will always write all data, store the data on partial write, 
or simply ignore remaining data on partial write.

I recall a "write1" function which was well defined: limited to 1 syscall, 
don't try (or maybe only on the very specific case of EINTR). But I'm not sure 
that it still exists in the io module of Python 3.

asyncio has also issues with the definition of "partial write" in its API.

You propose to fix the issue in socketserver.

socket.makefile(bufsize=0).write() uses send() and so use partial write. Are 
you sure that users are prepared for that? Maybe SocketIO must be modified to 
use sendall() when bufsize=0?

--
nosy: +haypo

___
Python tracker 

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



[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

from_object_v4.patch LGTM, nice enhancement.

--

___
Python tracker 

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



[issue17339] bytes() TypeError message is misleadingly narrow

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

The int.from_bytes() behaviour seems to have been documented from the 
beginning, so maybe it was intended.

--

___
Python tracker 

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



[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2016-04-14 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +michael.foord

___
Python tracker 

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



[issue20607] multiprocessing cx_Freeze windows GUI bug (& easy fixes)

2016-04-14 Thread Alwin Kahlert

Alwin Kahlert added the comment:

I have also trouble with this bug. It wasn't fixed in Python 3.4 and Python 
3.5. It should be reopened.

--
nosy: +Alwin Kahlert

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyUnicode_FSDecoder() is used in following functions in the stdlib:

compile()
symtable.symtable()
parser.compile()
parser.compilest()
zipimporter.zipimporter()
_imp.load_dynamic() (before 3.5)

This is behavior of PyUnicode_FSDecoder() from the start (issue9542). All above 
functions accepted only str in 3.1, thus accepting bytes object and others was 
new feature.

None tests are failed if reject non-str and non-bytes argument in 
PyUnicode_FSDecoder(). But none tests are failed even if disable support of 
bytes argument (there is a lack of tests for bytes path).

What should we do?

1. Add a warning when the argument neither str nor supporting the buffer 
protocol.

2. Drop support of non-str and not supporting the buffer protocol arguments 
without a warning.

3. Drop support of non-str and not supporting the buffer protocol arguments 
without a warning, and add a warning when the argument neither str nor bytes.

4. Drop support of non-str and non-bytes arguments without a warning.

--
nosy: +haypo

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-14 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Maybe an workflow like the one proposed in issue #26359 can be helpful in these 
development phases.

--

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-14 Thread Martin Panter

Martin Panter added the comment:

I agree it is a bit strange. It looks like it is a victim of 
PyBytes_FromObject() doing more than it says; its documentation only mentions 
the buffer protocol, not accepting iterables.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26755] Update version{added,changed} docs in devguide

2016-04-14 Thread Berker Peksag

New submission from Berker Peksag:

This is a follow-up from issue 26366:

"the original intention was to use "versionadded" where the API item is 
completely new.  So "The parameter x was added" in a function is using 
"versionchanged" because only an aspect of the function's signature was 
changed."

See msg260314 and msg260509 for details.

--
components: Devguide
files: versionchanged.diff
keywords: patch
messages: 263393
nosy: berker.peksag, ezio.melotti, georg.brandl, willingc
priority: normal
severity: normal
stage: patch review
status: open
title: Update version{added,changed} docs in devguide
type: behavior
Added file: http://bugs.python.org/file42461/versionchanged.diff

___
Python tracker 

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



[issue26057] Avoid nonneeded use of PyUnicode_FromObject()

2016-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 19dec08e54a8 by Serhiy Storchaka in branch 'default':
Issues #26716, #26057: Regenerate Argument Clinic code.
https://hg.python.org/cpython/rev/19dec08e54a8

--

___
Python tracker 

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



[issue26716] EINTR handling in fcntl

2016-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9ffe055f2b0e by Serhiy Storchaka in branch '3.5':
Issue #26716: Regenerate Argument Clinic code.
https://hg.python.org/cpython/rev/9ffe055f2b0e

New changeset 19dec08e54a8 by Serhiy Storchaka in branch 'default':
Issues #26716, #26057: Regenerate Argument Clinic code.
https://hg.python.org/cpython/rev/19dec08e54a8

--

___
Python tracker 

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



[issue26749] Update devguide to include Fedora's DNF

2016-04-14 Thread Berker Peksag

Berker Peksag added the comment:

Committed in 0ed2497e5aa4. Thanks for the patch, Luiz.

--
components: +Devguide -Documentation
nosy: +berker.peksag, ezio.melotti, willingc
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



[issue26749] Update devguide to include Fedora's DNF

2016-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0ed2497e5aa4 by Berker Peksag in branch 'default':
Issue #26749: Update devguide to include DNF package manager
https://hg.python.org/devguide/rev/0ed2497e5aa4

--
nosy: +python-dev

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I agree this doens't make sense.

--
nosy: +pitrou

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-14 Thread Stefan Krah

Stefan Krah added the comment:

On Thu, Apr 14, 2016 at 08:55:25AM +, Stefan Krah wrote:
> I use it all the time in development:

... where "it" refers to "./configure && make", not to PGO.

--

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 14.04.2016 10:39, Alecsandru Patrascu wrote:
> 
> @Stefan and @Marc, you say that people don't want to wait for PGO to build 
> when running ./configure && make, but why? Even though many developers use 
> it, this mode is not intended for development, it is production level and 
> should be run once (or at leas a limited number or times), when the 
> developers are sure that everything is fine in the debug mode. As Victor 
> previously said, we should have all the *good* stuff (PGO, LTO, etc) enabled 
> by default, regardless the time needed to do it.

You need to compile Python a lot during Python development and
here the compile speed matters, the performance of the resulting
binary is secondary (as long as it is consistent).

For production, it's easily possible to add those options to configure,
plus it's not 100% clear whether all optimizations really do create
correct code. We've had lots of issues with optimization errors in
compilers in the past and have generally been rather conservative with
the default optimization settings. It's better to have a stable running
Python, than a Python that is fast at failing or creating wrong
results ;-)

I think having these extra options readily accessible and
working is great, and people who know what they are doing can
then use them for the benefit of getting an even faster Python.

Distributors will know what they are doing, so many Python
users will still be able to benefit from them.

--

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-14 Thread Stefan Krah

Stefan Krah added the comment:

On Thu, Apr 14, 2016 at 08:39:20AM +, Alecsandru Patrascu wrote:
> @Stefan and @Marc, you say that people don't want to wait for PGO to build 
> when running ./configure && make, but why? Even though many developers use 
> it, this mode is not intended for development, it is production level and 
> should be run once (or at leas a limited number or times), when the 
> developers are sure that everything is fine in the debug mode. As Victor 
> previously said, we should have all the *good* stuff (PGO, LTO, etc) enabled 
> by default, regardless the time needed to do it.

I use it all the time in development:

  - For running math tests that would be too slow otherwise.

  - To diagnose invalid accesses that only occur with -O2.

  - To speed up Valgrind runs.

--

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-14 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

@Stefan and @Marc, you say that people don't want to wait for PGO to build when 
running ./configure && make, but why? Even though many developers use it, this 
mode is not intended for development, it is production level and should be run 
once (or at leas a limited number or times), when the developers are sure that 
everything is fine in the debug mode. As Victor previously said, we should have 
all the *good* stuff (PGO, LTO, etc) enabled by default, regardless the time 
needed to do it.

@Victor, indeed, LTO is not yet good enough to use it stand-alone in CPython. 
That is the reason why it is enabled only with PGO, because applied over it, we 
obtain further speedups than PGO alone. Also Ubuntu uses PGO and LTO in their 
releases.

But in the end maybe `./configure --with-lto && make profile-opt` will have to 
do for everybody.

--

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-04-14 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Maybe that end users are lazy and want to type just `make` and let things 
happen magically behind the scenes :-)

--

___
Python tracker 

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



[issue26753] Obmalloc lock LOCK_INIT and LOCK_FINI are never used

2016-04-14 Thread Larry Hastings

Larry Hastings added the comment:

There's already a comment saying that the macros are empty because the GIL 
protects obmalloc from parallelization.

I'd be happy to improve the code and add calls for LOCK_INIT and LOCK_FINI in 
the proper places.  You don't have to do it.  Since this isn't your goof I'll 
go ahead and own it.

--
assignee: haypo -> larry

___
Python tracker 

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



[issue26753] Obmalloc lock LOCK_INIT and LOCK_FINI are never used

2016-04-14 Thread STINNER Victor

STINNER Victor added the comment:

These macros are very old, I didn't write them. They are not used since the
API rely on the GIL.

Do you want to remove them?

I think that it's ok to keep them, just in case, if tomorrow we want to
support multiple allocations in parallel. Maybe a comment should explain
that these macros are not used because of the GIL.

--

___
Python tracker 

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



[issue22005] datetime.__setstate__ fails decoding python2 pickle

2016-04-14 Thread Christian Tanzer

Christian Tanzer added the comment:

This issue is getting old. Is there any way to solve this for Python 3.6?

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is the output of `import sysconfig; print sysconfig.get_config_vars()`?

--

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-14 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

PyUnicode_FSDecoder() accepts not only str and bytes or bytes-like object, but 
arbitrary iterable, e.g. list.

Example:

>>> compile('', [116, 101, 115, 116], 'exec')
 at 0xb6fb1340, file "test", line 1>

I think accepting arbitrary iterables is unintentional and weird behavior.

--
components: Interpreter Core
messages: 263378
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: PyUnicode_FSDecoder() accepts arbitrary iterable
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



[issue26753] Obmalloc lock LOCK_INIT and LOCK_FINI are never used

2016-04-14 Thread Larry Hastings

New submission from Larry Hastings:

Obmalloc now has theoretical support for locking.  I say theoretical because 
I'm not convinced it's ever been used.

The interface is defined through five macros:
SIMPLELOCK_DECL
SIMPLELOCK_INIT
SIMPLELOCK_FINI
SIMPLELOCK_LOCK
SIMPLELOCK_UNLOCK

Internally these are used to define an actual lock to be used in the module.  
The lock, "_malloc_lock", is declared, then four defines are made building on 
top of the SIMPLELOCK macros, named:
LOCK
UNLOCK
LOCK_INIT
LOCK_FINI

LOCK_INIT and LOCK_FINI are never called.  So unless your lock doesn't happen 
to require initialization or shutdown, this API is misimplemented.

Victor: this was your work, right?  If not, sorry, please unassign/de-nosy 
yourself.

--
assignee: haypo
components: Interpreter Core
messages: 263377
nosy: haypo, larry
priority: low
severity: normal
stage: needs patch
status: open
title: Obmalloc lock LOCK_INIT and LOCK_FINI are never used
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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Raghu

Raghu added the comment:

There is no output for `python -m sysconfig`

--

___
Python tracker 

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



[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2016-04-14 Thread James

New submission from James:

>>> import mock
>>> print mock.__version__
2.0.0
>>> 

=
test.py
from mock import Mock,call

class BB(object):
def __init__(self):pass
def print_b(self):pass
def print_bb(self,tsk_id):pass


bMock = Mock(return_value=Mock(spec=BB))
bMock().print_bb(20)
bMock().assert_has_calls([call.print_bb(20)])


===
Traceback (most recent call last):
  File "test.py", line 11, in 
bMock().assert_has_calls([call.print_bb(20)])
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 969, in 
assert_has_calls
), cause)
  File "/usr/lib/python2.7/site-packages/six.py", line 718, in raise_from
raise value
AssertionError: Calls not found.
Expected: [call.print_bb(20)]
Actual: [call.print_bb(20)]

===
print expected in mock.py assert_has_calls()

result is:
[TypeError('too many positional arguments',)]

--
files: test.py
messages: 263375
nosy: jekin000, rbcollins
priority: normal
severity: normal
status: open
title: Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file42460/test.py

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-04-14 Thread Stefan Krah

Stefan Krah added the comment:

Not acceptable, I'm afraid. See #25702.  I'm not sure why it is
considered so bothersome to type --with-pgo and --with-lto for
the rare case of a real production build.

--

___
Python tracker 

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



[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is the output of `python -m sysconfig`?

Python 2.7.3 is too old. May be this issue was already fixed in newer versions. 
Can you install 2.7.11?

--

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-04-14 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Hello Victor, 

Indeed, the best outcome is to have PGO, LTO, etc enabled by default when 
running ./configure && make, for production level. I also feel that they should 
be on by default, if only developers would use the debug version.

Do you think that modifying the patches attached to this issue and enabling all 
optimizations by default could be considered acceptable by the Python community?

Thank you,
Alecsandru

--

___
Python tracker 

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



[issue26748] enum.Enum is False-y

2016-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 772805538caf by Ethan Furman in branch '3.4':
Issue26748: Enum classes should evaluate as True
https://hg.python.org/cpython/rev/772805538caf

New changeset f840608f79da by Ethan Furman in branch '3.5':
Issue26748: Enum classes should evaluate as True
https://hg.python.org/cpython/rev/f840608f79da

New changeset 2fc61f8ee2d2 by Ethan Furman in branch 'default':
Issue26748: Enum classes should evaluate as True
https://hg.python.org/cpython/rev/2fc61f8ee2d2

--
nosy: +python-dev

___
Python tracker 

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