[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-17 Thread Steven Adams

Steven Adams added the comment:

Shouldn't that mean it also breaks on py3.3?

As a workaround i just import uuid later within the thread method.

--

___
Python tracker 

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



[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-17 Thread Xiang Zhang

Xiang Zhang added the comment:

It seems a matter of lib uuid. The comments in uuid.py tells that the module is 
not thread-safe. I try to comment out the code using ctypes and rerun your 
sample, it works well. 

In uuid's documentation it does not mention the non-thread-safe characteristic. 
Maybe we should add it.

--
nosy:  -pitrou

___
Python tracker 

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



[issue25987] collections.abc.Reversible

2016-04-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7d9f7d7a21ae by Georg Brandl in branch 'default':
#25987: add versionadded to Reversible.
https://hg.python.org/cpython/rev/7d9f7d7a21ae

--

___
Python tracker 

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



[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-17 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +pitrou, xiang.zhang

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-17 Thread Nick Coghlan

Nick Coghlan added the comment:

Looking at the history of the dis module, I'd now class this as a bug fix for 
3.5+ - it looks like dis.dis gained the ability to disassemble static and class 
methods as a side-effect of the removal of bound methods in Python 3 (see 
https://hg.python.org/cpython/rev/48af6375207e ) but because it was a side 
effect, the additional changes needed to also handle them when disassembling a 
class were missed.

--

___
Python tracker 

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



[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-17 Thread Steven Adams

Steven Adams added the comment:

I forgot to mention if i remove import uuid all works as expected.

--

___
Python tracker 

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



[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-17 Thread Steven Adams

New submission from Steven Adams:

I've ran into a strange issue after trying to port a project to support py 3.x

The app uses a double os.fork to run in the background. On py 3.4+ it seems 
that when you have an import uuid statement it causes threading.threads to 
always return false on is_alive()..

Here is an example of the issue. You can see i've imported uuid. This script 
should fork into the background and stay alive for at least 3 loops (3 seconds) 
but it dies after 1 loop as self._thread.is_alive() return False??

http://paste.pound-python.org/show/WbDkqPqu94zEstHG6Xl1/

This does NOT happen in py 2.7 or py3.3. Only occurs py3.4+

--
components: Interpreter Core
messages: 263640
nosy: Steven Adams
priority: normal
severity: normal
status: open
title: uuid causing thread issues when forking using os.fork py3.4+
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue25243] decouple string-to-boolean logic from ConfigParser.getboolean and offer as separate function

2016-04-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm not sure I see the point in moving this out to a separate method (i.e. I 
wouldn't want to see people importing configparser just to use this particular 
group of boolean word aliases).  In general, users would be better served by a 
simple dictionary that gives them the ability to say exactly which variants 
they want to allow ('y', 'n', 'enabled', 'disabled', etc).

Also, the preposition "from" in a method name usually indicates a classmethod 
that creates instances of the class where it is defined.

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue26792] docstrings of runpy.run_{module,path} are rather sparse

2016-04-17 Thread Antony Lee

New submission from Antony Lee:

$ pydoc runpy

run_module(mod_name, init_globals=None, run_name=None, alter_sys=False)
Execute a module's code without importing it

Returns the resulting top level namespace dictionary

run_path(path_name, init_globals=None, run_name=None)
Execute code located at the specified filesystem location

Returns the resulting top level namespace dictionary

The file path may refer directly to a Python script (i.e.
one that could be directly executed with execfile) or else
it may refer to a zipfile or directory containing a top
level __main__.py script.

The meaning of the arguments should be documented (e.g. by copy-pasting the 
html docs).  (And some sentences are missing final dots.)

--
assignee: docs@python
components: Documentation
messages: 263638
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: docstrings of runpy.run_{module,path} are rather sparse
versions: Python 3.5

___
Python tracker 

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



[issue26785] repr of -nan value should contain the sign

2016-04-17 Thread Hrvoje Abraham

Hrvoje Abraham added the comment:

Sage:
http://doc.sagemath.org/html/en/reference/rings_numerical/sage/rings/complex_number.html

>>> log(ComplexNumber(NaN,1))
NaN - NaN*I

--

___
Python tracker 

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



[issue25987] collections.abc.Reversible

2016-04-17 Thread Guido van Rossum

Guido van Rossum added the comment:

Because it's a change to collections.abc, it goes in 3.6 only.

--

___
Python tracker 

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



[issue26785] repr of -nan value should contain the sign

2016-04-17 Thread Hrvoje Abraham

Hrvoje Abraham added the comment:

Regarding NaN sign bit, IEEE-754 states:

"Note, however, that operations on bit strings—copy, negate, abs, 
copySign—specify the sign bit of a NaN result, sometimes based upon the sign 
bit of a NaN operand. The logical predicate totalOrder is also affected by the 
sign bit of a NaN operand."

So NaN sign bit information is used in the standard itself (section 5.10.d):

1) totalOrder(−NaN, y) is true where −NaN represents a NaN with negative sign 
bit and y is a
   floating-point number.
2) totalOrder(x, +NaN) is true where +NaN represents a NaN with positive sign 
bit and x is a
   floating-point number.

This fact alone implies the importance of its round-trip safety. I believe the 
quote you picked states this information doesn't have universal (standardized) 
meaning, not it is not important or used at all. It is reasonable to assume 
some will need to preserve it.

There are also some real-life usages, similar as signed zero, in determining 
the correct complex plane branch cut:
http://stackoverflow.com/questions/8781072/sign-check-for-nan-value
http://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/catan.3M.html
catan(inf + iNAN) => π/2 + i0; catan(inf - iNAN) => π/2 - i0;

MSVC 2015 and MinGW-W64 v4.9.2 output (source below) for '-nan' values are:

MSVC:  -nan(ind)
MinGW-W64: -1.#IND00


#include 

int main()
{
double x = 0.0;
x = - x / x;
printf("%lf\n", x);

return 0;
}

--

___
Python tracker 

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



[issue25386] msvcrt_putch/msvcrt_putwch don't check the return value of _putch/_putwch

2016-04-17 Thread Josh Snider

Josh Snider added the comment:

Here's a patch that raises an exception when _put[w]ch and _get[w]ch[e] are run 
without a console. Like Eryk Sun says, the get's work fine if you do unget 
before hand.

--
keywords: +patch
nosy: +Josh Snider
Added file: http://bugs.python.org/file42501/issue25386.patch

___
Python tracker 

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



[issue26785] repr of -nan value should contain the sign

2016-04-17 Thread Hrvoje Abraham

Hrvoje Abraham added the comment:

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit 
(AMD64)] on win32:

>>> import struct
>>> x=float("-nan")
>>> struct.pack('

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



[issue26785] repr of -nan value should contain the sign

2016-04-17 Thread Mark Dickinson

Mark Dickinson added the comment:

Gah, sorry. I misdiagnosed the Python 2.7 issue (I was looking at the code for 
the wrong branch). See issue 22590 for the correct diagnosis.

--

___
Python tracker 

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



[issue26785] repr of -nan value should contain the sign

2016-04-17 Thread Mark Dickinson

Mark Dickinson added the comment:

About the Python 2.7 behaviour:

>>> from math import copysign
>>> x = float("-nan")
>>> copysign(1.0, x)
1.0

I'd be interested to know what `struct.pack('

___
___
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-04-17 Thread Meador Inge

Meador Inge added the comment:

If I follow this correctly, then it seems like there are two
main pieces to this patch:

  1. Consolidating the following methods into `bytes_methods.c`:

 a. {bytes, bytearray}_find_internal

 b. {bytes, bytearray}_find

 c. {bytes, bytearray}_count

 d. {bytes, bytearray}_index

 e. {bytes, bytearray}_rfind

 f. {bytes, bytearray}_rindex

 g. {bytes, bytearray}_contains

 h. (_bytes, _bytearray}_tailmatch

 i. {bytes, bytearray}_startswith

 j. {bytes, bytearray}_endswith

  2. Consolidating the redundant implementations of the following functions
 into the stringlib:

 a. return_self

 b. countchar

 c. replace_interleave

 d. replace_delete_single_character

 e. replace_delete_substring

 f. replace_single_character_in_place

 g. replace_substring_in_place

 h. replace_single_character

 i. replace_substring

 j. replace

If so, then that seems reasonable to me and a nice cleanup.

A few comments:

  1. The diffs are fairly large.  It might be easier to follow if you stage
 the two steps above as separate commits (if possible).

  2. Why are some of the namings in stringlib inconsistent?  For example,
 `stringlib_method_find` and `stringlib_index`.  In other words, why
 do some names have the *_method_* part?

--
nosy: +meador.inge
stage:  -> patch review

___
Python tracker 

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



[issue26785] repr of -nan value should contain the sign

2016-04-17 Thread Mark Dickinson

Mark Dickinson added the comment:

> it is actually used in real-life situations

Do you have any examples available?

--

___
Python tracker 

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



[issue26785] repr of -nan value should contain the sign

2016-04-17 Thread Mark Dickinson

Mark Dickinson added the comment:

The current behaviour is deliberate, so any change would be an enhancement 
rather than a bugfix. I'm modifying the versions accordingly.

Unlike the sign of a zero, the sign of a NaN has no useful meaning: IEEE 754 
explicitly says "this standard does not interpret the sign of a NaN". Yes, that 
sign is copied by copysign, but I don't think that in itself means that the 
sign should be included in the repr, and I'm not aware of any applications 
where the sign matters in that context.

A NaN also has 51 payload bits (or 52 if you're not distinguishing between 
quiet and signalling NaNs), but like the sign, those bits are rarely important 
in applications.

I'm not really seeing a case for representing either the sign or the payload 
bits in the repr. Do you know of any applications that make use of the sign of 
a NaN?

--
versions:  -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue26733] staticmethod and classmethod are ignored when disassemble class

2016-04-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

Nick, do you consider this as a new feature, or as a fix?

--

___
Python tracker 

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



[issue26642] Replace stdout and stderr with simple standard printers at Python exit

2016-04-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I meant that C files stderr and stdout can be closed. Or it's file descriptors 
can be closed. I think in these cases fileno() or PyFile_NewStdPrinter() will 
fail.

I'm trying to consider all possible cases. Standard streams can be:

* Left original.
* Set to None.
* Reopened with different encoding/errors/etc.
* Redirected to a file (/dev/null).
* Redirected to a socket.
* Redirected to inherited file descriptor (pipe) in a subprocess.
* Be a high level wrapper around RPC (IDLE subprocess).

If the stream was reopened with the same file descriptor and closefd=True, 
closing it invalidates just opened "standard printer".

I would replace stdout and stderr after PyImport_Cleanup(). But 
PyImport_Cleanup() cleans up the sys module! Thus we should do this inside 
PyImport_Cleanup().

--

___
Python tracker 

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



[issue26788] test_gdb fails all tests on a profile-opt build configured --with-lto

2016-04-17 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

I will investigate this issue to understand what is happening there and submit 
a fix. Thank you for pointing out the exact OS and toolchain used.

--

___
Python tracker 

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



[issue26787] test_distutils fails when configured --with-lto

2016-04-17 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

I will investigate this and submit a fix. At a first glance, it seems the test 
is failing because it does not have the knowledge of the LTO flags.

--

___
Python tracker 

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



[issue26720] memoryview from BufferedWriter becomes garbage

2016-04-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Python implementation passes bytearray to underlying write and delete it's 
content just after that. Thus saving written data was never worked, and making 
it working don't worth efforts. I agree with you, we should add a warning 
against saving. This might be a part of issue20699.

As for original issue, this is potential crash, and we should fix this.

--

___
Python tracker 

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



[issue26627] IDLE incorrectly labeling error as internal

2016-04-17 Thread ppperry

ppperry added the comment:

Duplicate issue24252, although the consequences are slightly different.

--
nosy: +ppperry

___
Python tracker 

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



[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2016-04-17 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

> @mbussonn - I don't see an updated non-tty-checking patch from you?

Sorry for the delay, trying to get back on this. 

Please find attached a new patch that does not check whether is is a tty.
Still struggling a bit with HG (looking fwd to migration to GH)

--
Added file: 
http://bugs.python.org/file42500/enable_deprecation_warnings_in_repl_no_check_tty.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-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Issue26767 looks too complex and resolving it needs much more rewriting.

--
resolution: remind -> 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



[issue26745] Redundant code in _PyObject_GenericSetAttrWithDict

2016-04-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e5149789e4ea by Serhiy Storchaka in branch 'default':
Issue #26745: Removed redundant code in _PyObject_GenericSetAttrWithDict.
https://hg.python.org/cpython/rev/e5149789e4ea

--
nosy: +python-dev

___
Python tracker 

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



[issue26773] Shelve works inconsistently when carried over to child processes

2016-04-17 Thread Paul Ellenbogen

Paul Ellenbogen added the comment:

I think this behavior is due to the underlying behavior of the dbm. The same 
code using dbm, rather than shelve, also throws KeyErrors:

from multiprocessing import Process
import dbm

db = dbm.open("example.dbm", "c")
for i in range(100):
db[str(i)] = str(i ** 2)


def parallel():
for i in range(100):
print(db[str(i)])

a = Process(target = parallel)
b = Process(target = parallel)
a.start()
b.start()
a.join()
b.join()

--

___
Python tracker 

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



[issue26767] Inconsistant error messages for failed attribute modification

2016-04-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
priority: normal -> low

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2016-04-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue26791] shutil.move fails to move symlink (Invalid cross-device link)

2016-04-17 Thread Renato Alves

Renato Alves added the comment:

Also related to http://bugs.python.org/issue212317

--

___
Python tracker 

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



[issue26791] shutil.move fails to move symlink (Invalid cross-device link)

2016-04-17 Thread Renato Alves

Changes by Renato Alves :


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



[issue26791] shutil.move fails to move symlink (Invalid cross-device link)

2016-04-17 Thread Renato Alves

New submission from Renato Alves:

Hi everyone,

I'm not really sure if this is a new issue but digging through the bug reports 
from the past I couldn't find an answer.
There's http://bugs.python.org/issue1438480 but this seems to be a different 
issue.
I also found http://bugs.python.org/issue9993 that addressed problems with 
symlinks but didn't correct the behavior reported here.

The problem can be visualized with the following code.
Code fails on python 2.7 as well as python 3.4+. Not tested in python <2.7 and 
<3.4.


import shutil
import os

TMPDIR = "/tmp/tmpdir"
TESTLINK = "test_dir"

if not os.path.isdir(TMPDIR):
os.mkdir(TMPDIR)

if not os.path.islink(TESTLINK):
os.symlink(TMPDIR, TESTLINK)

shutil.move(TESTLINK, TMPDIR)


When executed it gives me:

% python3 test.py
Traceback (most recent call last):
  File "test.py", line 14, in 
shutil.move(TESTLINK, TMPDIR)
  File "/usr/lib64/python3.4/shutil.py", line 516, in move
os.rename(src, dst)
OSError: [Errno 18] Invalid cross-device link: 'test_dir' -> '/tmp/tmpdir'


This happens because /tmp is:

  tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,nodiratime)


In the past the recommendation to handle this problem was to stop using 
os.rename and use shutil.move instead.
This was even discussed in a bug report - http://bugs.python.org/issue14848

If one searches for this exception there's plenty of advice [1][2][3][4] in the 
same direction.
However, given that shutil.move uses os.rename internally, the problem returns.

On the other end doing the equivalent action in the shell with 'mv' works fine.


[1] - http://stackoverflow.com/a/15300474
[2] - https://mail.python.org/pipermail/python-list/2005-February/342892.html
[3] - 
http://www.thecodingforums.com/threads/errno-18-invalid-cross-device-link-using-os-rename.341597/
[4] - https://github.com/pypa/pip/issues/103

--
components: Library (Lib)
messages: 263616
nosy: Unode
priority: normal
severity: normal
status: open
title: shutil.move fails to move symlink (Invalid cross-device link)
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



[issue26790] bdist_msi package duplicates everything to a bogus location when run with /passive or /q

2016-04-17 Thread SilentGhost

Changes by SilentGhost :


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



[issue26790] bdist_msi package duplicates everything to a bogus location when run with /passive or /q

2016-04-17 Thread Ivan Pozdeev

New submission from Ivan Pozdeev:

First, the background information so you understand what I am talking about.

bdist_msi-produced packages work in the following way:

The files to install are presented as at least 3 equivalent sets (implemented 
as Features): "Python" (for Python from registry), "PythonX" (for 
Python from a custom location) and a hidden but always selected "Python" - a 
"source" set.
Files in them are linked together with DuplicateFiles, with "real" files in the 
"Python" set.

"Python" has the installation target set to TARGETDIR that has the default 
value specified as "SourceDir" (practice shows it's initially set to the root 
of the drive where the .msi being installed is).
The other two have default locations set to subdirectories of TARGETDIR, but 
PYTHON is changed to the root of the installed Python early on (at 
AppSearch stage and custom actions just after it in both InstallUISequence and 
InstallExecuteSequence) if an installtion is detected.

Now, at SelectFeaturesDlg in InstallUISequence, TARGETDIR is changed to a 
location for one of the features selected for install (initially, 
"Python" is selected if an installation was found). Later, as a public 
property, it's passed to InstallExecuteSequence, acting as the new default 
value.

Finally, the files are installed to TARGETDIR and _duplicated_ to locations for 
all other features that have been selected. So, if only one feature was 
selected (the common scenario), TARGETDIR is equal to its location, so no 
duplication takes place. If nothing was selected, everything is unpacked to the 
directory where the .msi is, like `tar' does. (The latter is extremely weird 
for an .msi but is quite in line with the logic for other types of `bdist_' 
packages.)



Now, the problem is:
* the aforementioned TARGETDIR switch is implemented as an event handler in the 
SelectFeaturesDlg dialog.
* if I run with /passive or /q, InstallUISequence isn't done, the dialog isn't 
shown, and the event never happens.
* so TARGETDIR remains the default, and MSI installs everything to whatever 
that default happened to be, then duplicates to the correct location.



To fix this, we need to somehow duplicate the Python detection and TARGETDIR 
switch to InstallExecuteSequence, avoiding overwriting the results of earlier 
actions.

Current workaround is to pass "TARGETDIR=" to msiexec.

--
components: Distutils, Library (Lib), Windows
files: mercurial-3.7.3.log.gz
messages: 263615
nosy: Ivan.Pozdeev, dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: bdist_msi package duplicates everything to a bogus location when run 
with /passive or /q
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42499/mercurial-3.7.3.log.gz

___
Python tracker 

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



[issue25987] collections.abc.Reversible

2016-04-17 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I see that I forgot to include .. versionadded:: in the documentation.
Will this go into 3.5.2 or in 3.6?

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
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-17 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file42498/fcntl_eintr-3.patch

___
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-17 Thread STINNER Victor

STINNER Victor added the comment:

I updated the test, does it look better now?

--

___
Python tracker 

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



[issue26789] Please do not log during shutdown

2016-04-17 Thread Matthias Urlichs

New submission from Matthias Urlichs:

… or, if you do, ignore errors.

This is during program shutdown. Unfortunately, I am unable to create a trivial 
example which exhibits the order of destruction necessary to trigger this 
problem.

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 93, in __del__
  File "/usr/lib/python3.5/asyncio/base_events.py", line 1160, in 
call_exception_handler
  File "/usr/lib/python3.5/logging/__init__.py", line 1308, in error
  File "/usr/lib/python3.5/logging/__init__.py", line 1415, in _log
  File "/usr/lib/python3.5/logging/__init__.py", line 1425, in handle
  File "/usr/lib/python3.5/logging/__init__.py", line 1487, in callHandlers
  File "/usr/lib/python3.5/logging/__init__.py", line 855, in handle
  File "/usr/lib/python3.5/logging/__init__.py", line 1047, in emit
  File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
NameError: name 'open' is not defined

--
components: asyncio
messages: 263612
nosy: gvanrossum, haypo, smurfix, yselivanov
priority: normal
severity: normal
status: open
title: Please do not log during shutdown
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread STINNER Victor

STINNER Victor added the comment:

> Changes look pretty innocent. LGTM.

Thanks. I pushed my change.

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



[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d268f108ba80 by Victor Stinner in branch 'default':
Avoid fcntl() if possible in set_inheritable()
https://hg.python.org/cpython/rev/d268f108ba80

--
nosy: +python-dev

___
Python tracker 

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



[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread STINNER Victor

STINNER Victor added the comment:

> Another question: should we handle EINTR in ioctl() and fcntl()? But this is 
> a different issue.

See attached test stress.py. I tried it with ioctl() and fcntl() 
implementations of os.set_inheritable() and I got more than 10,000 signals: no 
syscalls failed with EINTR.

IMHO EINTR is only used when the syscall waits, for example wait for I/O. I 
don't think that setting FD_CLOEXEC requires any I/O.

Example:

$ ./python stress.py 
got 16871 signals

--
Added file: http://bugs.python.org/file42497/stress.py

___
Python tracker 

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



[issue26774] Elide Py_atomic fences when WITH_THREAD is disabled?

2016-04-17 Thread STINNER Victor

STINNER Victor added the comment:

Discussion about --without-threads:

* May 2012
  https://mail.python.org/pipermail/python-dev/2012-May/119333.html
* Follow-up january 2013
  https://mail.python.org/pipermail/python-dev/2013-January/123505.html

--

___
Python tracker 

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



[issue26774] Elide Py_atomic fences when WITH_THREAD is disabled?

2016-04-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This sounds like additional hassle for not much gain. Agreed with Victor.

--
nosy: +pitrou

___
Python tracker 

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



[issue26786] bdist_msi duplicates directories with names in ALL CAPS to a bogus location

2016-04-17 Thread Ivan Pozdeev

Changes by Ivan Pozdeev :


--
keywords: +patch
Added file: http://bugs.python.org/file42496/bdist_msi.patch

___
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-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If I correctly understood, there is no visible bug, but there is a suboptimal 
code. The patch is welcome.

--
stage:  -> needs patch
type: behavior -> performance
versions:  -Python 3.5

___
Python tracker 

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



[issue26756] fileinput handling of unicode errors from standard input

2016-04-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Calling the openhook for the stdin will break existing code. Third-party 
openhooks don't special case the '' name, which is legitimate file name.

Instead I recommend to patch sys.stdin explicitly in your program.

sys.stdin = io.TextIOWrapper(sys.stdin.buffer, errors='replace')
for line in fileinput.input(openhook=hook):
...

--

___
Python tracker 

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



[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Another question: should we handle EINTR in ioctl() and fcntl()? But this is a 
different issue.

--

___
Python tracker 

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



[issue26770] _Py_set_inheritable(): do nothing if the FD_CLOEXEC close is already set/cleared

2016-04-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Changes look pretty innocent. LGTM.

--
assignee:  -> haypo
nosy: +steve.dower
stage:  -> commit review

___
Python tracker 

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



[issue26744] print() function hangs on MS-Windows 10

2016-04-17 Thread Ma Lin

Ma Lin added the comment:

faulthandler module caught a hang just now:

Timeout (0:01:00)!
Thread 0x0eb0 (most recent call first):
  File "D:\git\tz2txt\tz2txt\gui.py", line 262 in delfile
  File "C:\Python35\lib\tkinter\__init__.py", line 1549 in __call__
  File "C:\Python35\lib\tkinter\__init__.py", line 1131 in mainloop
  File "D:\git\tz2txt\tz2txt\gui.py", line 328 in main
  File "D:\git\tz2txt\tz2txt\gui.py", line 331 in 
  
 Here is the full delfile function:
  
  def delfile(self):
try:
output = self.output.get().strip()
os.remove(output)
except:
pass
else:
print('已删除输出文件')# <- line 262

try:
os.remove(discard_fn)
except:
pass
else:
print('已删除丢弃文件')

self.url.set(url_use)

~~
Some supplemental information:

There was a time point, *maybe* it's Windows10 Threshold2 (12/Nov/2015), before 
that time no hang at all.
After that time, the hangs were quite often.
Some months later, the frequency had declined a lot, but still hang 
occasionally.

--

___
Python tracker 

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



[issue26554] PC\bdist_wininst\install.c: Missing call to fclose()

2016-04-17 Thread Martin Panter

Martin Panter added the comment:

Adding aatishnn to nosy in case they aren’t aware of your review.

--
nosy: +aatishnn, martin.panter

___
Python tracker 

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



[issue26717] wsgiref.simple_server: mojibake with cp1252 bytes in PATH_INFO

2016-04-17 Thread Martin Panter

Changes by Martin Panter :


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



[issue26778] More typo fixes

2016-04-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue26778] More typo fixes

2016-04-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 395dd5630e6c by Serhiy Storchaka in branch '3.5':
Issue #26778: Fixed "a/an/and" typos in code comment and documentation.
https://hg.python.org/cpython/rev/395dd5630e6c

New changeset bbcde8db4dc4 by Serhiy Storchaka in branch '2.7':
Issue #26778: Fixed "a/an/and" typos in code comment and documentation.
https://hg.python.org/cpython/rev/bbcde8db4dc4

New changeset 932b330e22d8 by Serhiy Storchaka in branch 'default':
Issue #26778: Fixed "a/an/and" typos in code comment, documentation and error
https://hg.python.org/cpython/rev/932b330e22d8

--
nosy: +python-dev

___
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-17 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
dependencies: +test_gdb fails all tests on a profile-opt build configured 
--with-lto

___
Python tracker 

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



[issue26788] test_gdb fails all tests on a profile-opt build configured --with-lto

2016-04-17 Thread Gregory P. Smith

New submission from Gregory P. Smith:

cpython/build35.lto$ ./python ../3.5/Lib/test/test_gdb.py
GDB version 7.10:
GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
...
==
FAIL: test_tuples (__main__.PrettyPrintTests)
Verify the pretty-printing of tuples
--
Traceback (most recent call last):
  File "../3.5/Lib/test/test_gdb.py", line 359, in test_tuples
self.assertGdbRepr(tuple(), '()')
  File "../3.5/Lib/test/test_gdb.py", line 279, in assertGdbRepr
gdb_repr, gdb_output = self.get_gdb_repr('id(' + ascii(val) + ')')
  File "../3.5/Lib/test/test_gdb.py", line 255, in get_gdb_repr
self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
AssertionError: Unexpected gdb output: 'Breakpoint 1 at 0x4cc310\n[Thread 
debugging using libthread_db enabled]\nUsing host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".\n\nBreakpoint 1, builtin_id ()\n#0  
builtin_id ()\n'
Breakpoint 1 at 0x4cc310
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, builtin_id ()
#0  builtin_id ()

I don't know the right thing to do here.  This might depend on compiler, 
linker, arch and gdb version?  Are it's LTO executables debuggable?  It's not 
clear to me that we can do anything about this.  We may just want to skip the 
test when configured --with-lto.  Or perhaps this is an indication that this 
specific toolchain's LTO build (x86_64, ubuntu wily gcc 5.2.1 and gdb 7.1.0) 
has issues and shouldn't be used?

--
components: Build
messages: 263599
nosy: alecsandru.patrascu, gregory.p.smith
priority: normal
severity: normal
status: open
title: test_gdb fails all tests on a profile-opt build configured --with-lto
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



[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-17 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
dependencies: +test_distutils fails when configured --with-lto

___
Python tracker 

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



[issue26787] test_distutils fails when configured --with-lto

2016-04-17 Thread Gregory P. Smith

New submission from Gregory P. Smith:

When configured using './configure --with-lto' (added in issue25702) and doing 
a 'make profile-opt' build, test_distutils fails:

==
FAIL: test_sysconfig_compiler_vars 
(distutils.tests.test_sysconfig.SysconfigTestCase)
--
Traceback (most recent call last):
  File 
"/home/greg/sandbox/python/cpython/3.5/Lib/distutils/tests/test_sysconfig.py", 
line 156, in test_sysconfig_compiler_vars
sysconfig.get_config_var('LDSHARED'))
AssertionError: 'gcc -pthread -shared -flto -fuse-linker-plugin 
-ffat-lto-obje[20 chars]none' != 'gcc -pthread -shared'
- gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none
+ gcc -pthread -shared


==
FAIL: test_sysconfig_module (distutils.tests.test_sysconfig.SysconfigTestCase)
--
Traceback (most recent call last):
  File 
"/home/greg/sandbox/python/cpython/3.5/Lib/distutils/tests/test_sysconfig.py", 
line 133, in test_sysconfig_module
sysconfig.get_config_var('LDFLAGS'))
AssertionError: '-flto -fuse-linker-plugin -ffat-lto-objects 
-flto-partition=none' != ''
- -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none
+

--
components: Build
messages: 263598
nosy: alecsandru.patrascu, gregory.p.smith
priority: normal
severity: normal
status: open
title: test_distutils fails when configured --with-lto
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