[issue26737] csv.DictReader throws generic error when fieldnames is accessed for non-text file

2016-04-12 Thread Bayo Opadeyi

Bayo Opadeyi added the comment:

Yes, the problem is that the file is not csv. The scenario is a web application 
allowing people to upload csv files, but they can upload any files they like.

--
status: pending -> open

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

See also the issue #25003 and the changeset 835085cc28cd:

Issue #25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom() 
function instead of the getentropy() function. The getentropy() function is 
blocking to generate very good quality entropy, os.urandom() doesn't need such 
high-quality entropy.

--

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

> I've attached a possible patch for this issue, against the 3.5.1 source
tree.

I guess that you are already using Python 3.5.1 which uses getrandom(). You 
should try to confirm using strace.

I updated your patch. I replaced "#if defined(__sun__)" with "#ifdef sun", 
since "#ifdef sun" looks more common in the Python code base, and I never saw 
"#if defined(__sun__)" in the Python code base.

I also avoided the new len variable, I reused the n variable.

I don't have Solaris, so I cannot test. I didn't find getrandom() manual page 
neither, I only found this blog post which doesn't mention the 1024 bytes 
limitation on Solaris:
https://blogs.oracle.com/darren/entry/solaris_new_system_calls_getentropy

--
Added file: http://bugs.python.org/file42443/urandom_solaris.patch

___
Python tracker 

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



[issue26740] tarfile: accessing (listing and extracting) tarball fails with UnicodeDecodeError

2016-04-12 Thread Tomas Tomecek

New submission from Tomas Tomecek:

I have a tarball (generated by docker-1.10 via `docker export`) and am trying 
to extract it with python 2.7 tarfile:

```
with tarfile.open(name=tarball_path) as tar_fd:
tar_fd.extractall(path=path)
```

Output from a pytest run:

```
/usr/lib64/python2.7/tarfile.py:2072: in extractall
for tarinfo in members:
/usr/lib64/python2.7/tarfile.py:2507: in next
tarinfo = self.tarfile.next()
/usr/lib64/python2.7/tarfile.py:2355: in next
tarinfo = self.tarinfo.fromtarfile(self)
/usr/lib64/python2.7/tarfile.py:1254: in fromtarfile
return obj._proc_member(tarfile)
/usr/lib64/python2.7/tarfile.py:1276: in _proc_member
return self._proc_pax(tarfile)
/usr/lib64/python2.7/tarfile.py:1406: in _proc_pax
value = value.decode("utf8")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

input = 
'\x01\x00\x00\x02\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
 errors = 'strict'

def decode(input, errors='strict'):
>   return codecs.utf_8_decode(input, errors, True)
E   UnicodeDecodeError: 'utf8' codec can't decode byte 0xc0 in position 4: 
invalid start byte

/usr/lib64/python2.7/encodings/utf_8.py:16: UnicodeDecodeError
```

Since I know nothing about tars, I have no idea if this is a bug or there is a 
proper solution/workaround.

When using GNU tar, I'm able to to list and extract the tarball.

--
components: Unicode
messages: 263237
nosy: Tomas Tomecek, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: tarfile: accessing (listing and extracting) tarball fails with 
UnicodeDecodeError
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



[issue26740] tarfile: accessing (listing and extracting) tarball fails with UnicodeDecodeError

2016-04-12 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +lars.gustaebel
type:  -> behavior

___
Python tracker 

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



[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Nick Coghlan

Nick Coghlan added the comment:

+1 for Serhiy's suggestion of enhancing the C API to specifically handle these 
cases.

--
dependencies: +Add support for partial keyword arguments in extension functions

___
Python tracker 

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



[issue26740] tarfile: accessing (listing and extracting) tarball fails with UnicodeDecodeError

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

Can you give a link to the tar archive, or for example the first 256 KB of the 
archive?

--

___
Python tracker 

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



[issue26737] csv.DictReader throws generic error when fieldnames is accessed for non-text file

2016-04-12 Thread Berker Peksag

Berker Peksag added the comment:

> The scenario is a web application allowing people to upload csv files, but 
> they can upload any files they like.

This looks like a potential security flaw in the application. The application 
should reject any non-CSV files from being uploaded (instead of relying on the 
CSV module).

Thanks for the report.

--
nosy: +berker.peksag
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-12 Thread Petr Viktorin

Petr Viktorin added the comment:

buggy:
configuredFont: ('DejaVu Sans Mono', 0, 'normal')
fontSize: 0

good:
configuredFont: ('courier', 10, 'normal')
fontSize: 10

--

___
Python tracker 

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



[issue26740] tarfile: accessing (listing and extracting) tarball fails with UnicodeDecodeError

2016-04-12 Thread Tomas Tomecek

Tomas Tomecek added the comment:

Unfortunately I can't, since it's internal docker image. I have found a bug 
report in Red Hat bugzilla with more info: 
https://bugzilla.redhat.com/show_bug.cgi?id=1194473 Here's even a commit with a 
fix (via monkeypatching): 
https://github.com/goldmann/docker-squash/commit/81d1c4c18960a5d940be9b986ccbfaa7853aceb1

If needed, I can construct a minimal reporoducer.

--

___
Python tracker 

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



[issue25330] Docs for pkgutil.get_data inconsistent with semantics

2016-04-12 Thread WGH

WGH added the comment:

I think it can even be considered a security bug. A classic path traversal. The 
fact that documentation falsely suggests that there's no such vulnerability is 
clearly not helping.

Python 2.7 is affected as well, by the way.

--
nosy: +WGH

___
Python tracker 

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



[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Martin Panter

Martin Panter added the comment:

I didn’t realize about the keyword-only parameters. This is inherited from 
list.sort(). The signature can be corrected in 3.5.

There is also Issue 21314 about documenting the slash notation for signatures 
(it comes from PEP 457).

--

___
Python tracker 

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



[issue15994] memoryview to freed memory can cause segfault

2016-04-12 Thread Martin Panter

Martin Panter added the comment:

I recently created Issue 26720 about a similar situation with BufferedWriter. 
However I am starting to believe that the problem cannot be solved the way I 
originally wanted. Instead, the best solution there would be similar what I 
would suggest here: we need to avoid the user accessing the memoryview after 
readinto() or write() has returned. Some ideas, not all perfect:

1. Call memoryview.release() after the method returns. This would be simple and 
practical, but could be cheated by making a second memoryview of the original. 
Also, memoryview.release() is not guaranteed to succeed; there is code that 
raises BufferError("memoryview has exported buffers").

2. Raise an exception (BufferError or RuntimeError?) if readinto() or write() 
returns and the memoryview(s) are not all released. This doesn’t prevent a 
determined programmer from overwriting memory or losing written data, but it 
might let them know about the problem when it happens.

3. Try to force the memoryview.release() state on all views into the original 
memory. Is this practical? I guess this would be a bit inconsistent if some 
other thread was in the middle of a system call using the buffer at the time 
that we want to do the release.

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



[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Erik Welch

Erik Welch added the comment:

sorted_3.patch corrects the __text_signature__.  Behavior of sorted is 
unchanged.

>>> def raises(err, lamda):
... try:
... lamda()
... return False
... except err:
... return True
...
>>> import inspect
>>> sig = inspect.signature(sorted) 
>>> # `iterable` is positional-only
>>> assert raises(TypeError, lambda: sorted(iterable=[]))
>>> assert raises(TypeError, lambda: sig.bind(iterable=[]))
>>> # `key` and `reverse` are keyword-only
>>> assert raises(TypeError, lambda: sorted([], lambda x: x))
>>> assert raises(TypeError, lambda: sig.bind([], lambda x: x))

--
Added file: http://bugs.python.org/file42444/sorted_3.patch

___
Python tracker 

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



[issue20699] Document that binary IO classes work with bytes-likes objects

2016-04-12 Thread Martin Panter

Martin Panter added the comment:

After thinking about Issue 26720 (see also Issue 15994), I think it might be 
worth documenting not only that bytes-like objects may be passed, but in some 
cases the class should not be access the object after the method returns. This 
applies to at least RawIOBase.readinto() and especially RawIOBase.write(). If 
you want to save the write() data in memory, you have to make a copy, because 
the original may be lost when BufferedWriter overwrites its internal buffeer.

--

___
Python tracker 

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



[issue15994] memoryview to freed memory can cause segfault

2016-04-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
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-12 Thread Martin Panter

Martin Panter added the comment:

I realize there is another problem, and doing tricks with a bytes object won’t 
help that. BufferedWriter bypasses its own buffer for large writes:

>>> writer = BufferedWriter(Raw())
>>> large = bytearray(1)
>>> writer.write(large)
1
>>> written.tobytes()[:10]
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>> large[:5] = b"blaua"
>>> written.tobytes()[:10]
b'blaua\x00\x00\x00\x00\x00'

BufferedWriter is passing a view of the original input through, without any 
copying. Perhaps the simplest thing is to warn and prevent the user from 
accessing the buffer after write() returns. I suggested some imperfect ideas in 
Issue 15994. Maybe I should just close this as a duplicate.

--

___
Python tracker 

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



[issue25931] os.fork() command distributed in windows Python27 (in SocketServer module)

2016-04-12 Thread Anthony S Valencia

Changes by Anthony S Valencia :


--
nosy: +antvalencia

___
Python tracker 

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



[issue26699] locale.str docstring is incorrect: "Convert float to integer"

2016-04-12 Thread supriyanto maftuh,st

Changes by supriyanto maftuh,st :


--
nosy: +supriyanto maftuh

___
Python tracker 

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



[issue25609] Add a ContextManager ABC and type

2016-04-12 Thread supriyanto maftuh,st

Changes by supriyanto maftuh,st :


--
nosy: +supriyanto maftuh

___
Python tracker 

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



[issue26718] super.__init__ leaks memory if called multiple times

2016-04-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Do #1.

--Guido (mobile)
On Apr 11, 2016 11:31 PM, "Serhiy Storchaka"  wrote:

>
> Serhiy Storchaka added the comment:
>
> Possible solutions:
>
> 1. Correctly decref old values.
> 2. Raise an exception if super.__init__ is caled multiple times.
> 3. Remove super.__init__ and add super.__new__.
>
> What is more preferable?
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue25931] os.fork() command distributed in windows Python27 (in SocketServer module)

2016-04-12 Thread supriyanto maftuh,st

Changes by supriyanto maftuh,st :


--
nosy: +supriyanto maftuh
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



[issue26718] super.__init__ leaks memory if called multiple times

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



[issue24136] document PEP 448: unpacking generalization

2016-04-12 Thread supriyanto maftuh,st

supriyanto maftuh,st added the comment:

Hy

--
components: +Benchmarks, Build, IO, Unicode, Windows, XML, email
hgrepos: +336
nosy: +barry, brett.cannon, ezio.melotti, haypo, paul.moore, pitrou, 
r.david.murray, steve.dower, supriyanto maftuh, supriyanto maftuh,st, 
tim.golden, zach.ware
versions: +Python 2.7, 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



[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread supriyanto maftuh,st

supriyanto maftuh,st added the comment:

Easy to review with issues phyton, maintenanca by supriyanto maftuh

--
assignee:  -> docs@python
components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Benchmarks, 
Cross-Build, Demos and Tools, Devguide, Distutils, Documentation, Extension 
Modules, IDLE, IO, Installation, Interpreter Core, Macintosh, Regular 
Expressions, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email
hgrepos: +337
nosy: +Alex.Willmer, barry, brett.cannon, docs@python, dstufft, eric.araujo, 
ezio.melotti, gvanrossum, haypo, larry, mrabarnett, ned.deily, paul.moore, 
pitrou, r.david.murray, ronaldoussoren, steve.dower, supriyanto maftuh, 
supriyanto maftuh,st, tim.golden, willingc, yselivanov, zach.ware
versions: +Python 3.2, Python 3.6

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2016-04-12 Thread supriyanto maftuh,st

supriyanto maftuh,st added the comment:

Hy easy patch with editing maintenance by supriyanto maftuh

--
components: +Build, Documentation, Unicode, Windows, XML
hgrepos: +338
nosy: +paul.moore, steve.dower, supriyanto maftuh, supriyanto maftuh,st, 
tim.golden, zach.ware
versions: +Python 3.2, Python 3.3, Python 3.6

___
Python tracker 

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



[issue26718] super.__init__ leaks memory if called multiple times

2016-04-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
keywords: +patch
stage:  -> patch review
type: behavior -> resource usage
Added file: http://bugs.python.org/file42445/super_init_leaks.patch

___
Python tracker 

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



[issue25931] os.fork() command distributed in windows Python27 (in SocketServer module)

2016-04-12 Thread SilentGhost

Changes by SilentGhost :


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



[issue26718] super.__init__ leaks memory if called multiple times

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

super_init_leaks.patch LGTM, it fixes. I confirm that the patch fixes the 
refleak. I checked with:

$ ./python -m test -R 3:3 test_super

--

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

STINNER Victor added the comment:

@Serhiy: Would you mind reviewing replace_stdio-2.patch?

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-04-12 Thread supriyanto maftuh,st

Changes by supriyanto maftuh,st :


--
components: +Build, Extension Modules, Interpreter Core, Tkinter, Unicode, 
Windows, XML
hgrepos: +339
nosy: +dstufft, eric.araujo, ezio.melotti, paul.moore, steve.dower, tim.golden, 
zach.ware
versions: +Python 3.2

___
Python tracker 

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



[issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

Can someone please review pygettext_imp.patch?

(I send a ping since Roundup email notifications were broken recently.)

--

___
Python tracker 

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



[issue26610] test_venv.test_with_pip() fails when ctypes is missing

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

Since the initial issue is fixed, I close the issue.

You can revert my change if a new pip version works (again?) without ctypes.

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



[issue26716] EINTR handling in fcntl

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

> I think it would be nice to publish somewhere (on ActoveState receipts, on 
> StackOverflow) well-searchable correct example.

Yeah, it's always possible to enhance the doc. I'm not an user of ActiveState 
or StackOverflow websites. Don't hesitate to submit a comment to explain the 
PEP 475 ;-)

Is it ok to fix Python 3.5? Or is it safer to only fix the issue in Python 3.6?

--

___
Python tracker 

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



[issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib

2016-04-12 Thread supriyanto maftuh,st

Changes by supriyanto maftuh,st :


--
components: +Benchmarks, Demos and Tools, Unicode
hgrepos: +340
nosy: +ezio.melotti, pitrou, supriyanto maftuh
type:  -> compile error
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



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

2016-04-12 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
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-12 Thread supriyanto maftuh,st

Changes by supriyanto maftuh,st :


--
components: +Build, Tests, Unicode, Windows, XML
hgrepos: +341
nosy: +ezio.melotti, paul.moore, steve.dower, supriyanto maftuh, tim.golden, 
zach.ware

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread Matthew Ryan

Matthew Ryan added the comment:

The new patch looks fine; I used __sun__ rather than sun out of habit
(C standard requires
system specific macros be in the reserved namespace), but either will work.

I found the original problem through debugging with GDB, so I know
getrandom() was being
called, and the test case I provided (taken from Lib/Random.py) fails
without the patch,
and succeeds with it.

Oddly, the blog post you linked to describes getrandom as:
"Recent Linux kernels have a getrandom(2) system call that reads
between 1 and 1024 bytes of randomness"

But no such limit current exists in the Linux version that I can see;
however, the Solaris
version definitely does have that limit:
https://docs.oracle.com/cd/E53394_01/html/E54765/getrandom-2.html

On Tue, Apr 12, 2016 at 1:15 AM, STINNER Victor  wrote:
>
> STINNER Victor added the comment:
>
>> I've attached a possible patch for this issue, against the 3.5.1 source
> tree.
>
> I guess that you are already using Python 3.5.1 which uses getrandom(). You 
> should try to confirm using strace.
>
> I updated your patch. I replaced "#if defined(__sun__)" with "#ifdef sun", 
> since "#ifdef sun" looks more common in the Python code base, and I never saw 
> "#if defined(__sun__)" in the Python code base.
>
> I also avoided the new len variable, I reused the n variable.
>
> I don't have Solaris, so I cannot test. I didn't find getrandom() manual page 
> neither, I only found this blog post which doesn't mention the 1024 bytes 
> limitation on Solaris:
> https://blogs.oracle.com/darren/entry/solaris_new_system_calls_getentropy
>
> --
> Added file: http://bugs.python.org/file42443/urandom_solaris.patch
>
> ___
> Python tracker 
> 
> ___

--

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

STINNER Victor added the comment:

Again, the problem is that the exception exits from the function which owns the 
last reference to the Popen object. If the Popen is left alive when you exit 
the function, you create a zombi process, you can leave open pipes, etc.

It's unclear to me if CTRL+c sends SIGTERM to all processes or only a few of 
them (only the parent process?). Even if SIGTERM is sent to all processes, a 
child process can decide to completly ignore it, or can block in a deadlock or 
whatever.

Giving a few seconds to the child process to wait until it ends is not easy 
because it's hard to choose an arbitrary timeout. If the timeout is too low, 
you kill the child process (SIGKILL) before it flushes files. If the timeout is 
too long, the parent process is blocked too long when the child process is 
really blocked.

I suggest to keep the current behaviour by default.

If you really want to give time to the child process, I suggest to add a *new* 
optional parameter . For example ctrlc_timeout=5.0 to send SIGTERM and then 
wait 5 seconds.

I don't know if the parent process must always send a SIGTERM to the child 
process or not. One signal or two don't have the same behaviour. It's possible 
to explicitly send a SIGTERM to only one process using the kill command.

--

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

> The new patch looks fine

Do you mean that it fixes your issue? Can it be applied to Python 3.5 & 3.6?

--

___
Python tracker 

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



[issue24136] document PEP 448: unpacking generalization

2016-04-12 Thread Berker Peksag

Berker Peksag added the comment:

supriyanto maftuh,st, please don't play with tracker items.

--
components:  -Benchmarks, Build, IO, Unicode, Windows, XML, email
versions:  -Python 2.7, 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



[issue24136] document PEP 448: unpacking generalization

2016-04-12 Thread Berker Peksag

Changes by Berker Peksag :


--
Removed message: http://bugs.python.org/msg263250

___
Python tracker 

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



[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread Berker Peksag

Changes by Berker Peksag :


--
components:  -2to3 (2.x to 3.x conversion tool), Argument Clinic, Benchmarks, 
Build, Cross-Build, Demos and Tools, Devguide, Distutils, Documentation, 
Extension Modules, IDLE, IO, Installation, Interpreter Core, Macintosh, Regular 
Expressions, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email
stage:  -> patch review
versions:  -Python 2.7, 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



[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread SilentGhost

Changes by SilentGhost :


--
Removed message: http://bugs.python.org/msg263251

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2016-04-12 Thread Berker Peksag

Changes by Berker Peksag :


--
components:  -Build, Documentation, Unicode, Windows, XML
nosy:  -supriyanto maftuh, supriyantomaftuh
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

module_finder.patch: cleanup (optimize?) 
modulefinder.ModuleFinder.scan_opcodes_25(): Use an index rather than creating 
a lot of substrings.

It's unrelated to Wordcode, it's just that I noticed the inefficient code while 
reviewing the whole patch.

--
Added file: http://bugs.python.org/file42446/module_finder.patch

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2016-04-12 Thread Berker Peksag

Changes by Berker Peksag :


--
Removed message: http://bugs.python.org/msg263252

___
Python tracker 

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



[issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib

2016-04-12 Thread Berker Peksag

Changes by Berker Peksag :


--
components:  -Benchmarks, Unicode
stage:  -> patch review
type: compile error -> enhancement
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib

2016-04-12 Thread Berker Peksag

Berker Peksag added the comment:

pygettext_imp.patch looks good to me. I left a comment on Rietveld.

--

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7bf08a11d4c9 by Victor Stinner in branch 'default':
Issue #26647: Cleanup opcode
https://hg.python.org/cpython/rev/7bf08a11d4c9

New changeset 423e2a96189e by Victor Stinner in branch 'default':
Issue #26647: Cleanup modulefinder
https://hg.python.org/cpython/rev/423e2a96189e

New changeset f8398dba48fb by Victor Stinner in branch '3.5':
Issue #26647: Fix typo in test_grammar
https://hg.python.org/cpython/rev/f8398dba48fb

--
nosy: +python-dev

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-04-12 Thread Berker Peksag

Changes by Berker Peksag :


--
components:  -Build, Extension Modules, Interpreter Core, Tkinter, Unicode, 
Windows, XML
stage:  -> patch review
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



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

2016-04-12 Thread Berker Peksag

Changes by Berker Peksag :


--
components:  -Build, Tests, Unicode, Windows, XML

___
Python tracker 

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



[issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib

2016-04-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cd03ff74eaea by Victor Stinner in branch 'default':
Update pygettext.py to get ride of imp
https://hg.python.org/cpython/rev/cd03ff74eaea

--
nosy: +python-dev

___
Python tracker 

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



[issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

> pygettext_imp.patch looks good to me.

Thanks for the review.

> I left a comment on Rietveld.

Oops, I added it but then inlined the function in caller sites. I removed the 
now empty function :-)

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



[issue25330] Docs for pkgutil.get_data inconsistent with semantics

2016-04-12 Thread Brett Cannon

Brett Cannon added the comment:

This can't change in Python 2.7 because of backwards-compatibility. And I would 
argue this isn't a serious security risk as pkgutil.get_data() typically works 
with string constants and values provided by the library and not user-provided 
values. This is basically the same as taking a value for open() and has the 
same risks.

--

___
Python tracker 

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



[issue24136] document PEP 448: unpacking generalization

2016-04-12 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread Matthew Ryan

Matthew Ryan added the comment:

Yes, I've verified that:
* the issue existed in the default branch as of this morning.
* the patch applies cleanly against both 3.5 and default, and
addresses the issue in both branches.

--

___
Python tracker 

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



[issue26718] super.__init__ leaks memory if called multiple times

2016-04-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added more comments as suggested by Guido.

--
Added file: http://bugs.python.org/file42447/super_init_leaks_2.patch

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -339

___
Python tracker 

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



[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -337

___
Python tracker 

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



[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
assignee: docs@python -> 
nosy:  -docs@python, supriyanto maftuh, supriyantomaftuh, zach.ware
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



[issue19217] Calling assertEquals for moderately long list takes too long

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -338

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

Serhiy Storchaka added the comment:

I just don't know whether the patch will break existing code that relies on 
current behavior. If EINTR handling in other functions was not backported to 
older versions, I think this is good argument against fixing this issue in 3.5.

Could you write tests with signal handlers raising and not raising an exception?

--

___
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-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -341

___
Python tracker 

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



[issue26639] Tools/i18n/pygettext.py: replace deprecated imp module with importlib

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -340

___
Python tracker 

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



[issue24136] document PEP 448: unpacking generalization

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -336

___
Python tracker 

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



[issue23076] list(pathlib.Path().glob("")) fails with IndexError

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -331

___
Python tracker 

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



[issue25496] tarfile: Default value for compresslevel is not documented

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -330

___
Python tracker 

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



[issue25835] httplib uses print for debugging

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -327

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2016-04-12 Thread Zachary Ware

Changes by Zachary Ware :


--
hgrepos:  -334

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

Serhiy Storchaka added the comment:

I meant getting rid of memoryview at all and passing bytes buffer object 
directly to underlying write. But now I see that this idea perhaps is not 
feasible since we must write not only from the start of the buffer.

A writer like AuditableBytesIO is very attractive implementation. I used it 
multiple times, especially in tests. Your initial proposition LGTM, and perhaps 
this is only the solution applicable in maintained releases. Thus we should 
implement it in any case. In 3.6 we can add a warning.

Note that there are two kinds of references to a buffer: a reference to 
memoryview object and new memoryview that refers to the same buffer.

--

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thank you.  I believe a see a bug in configHandler.)idleConf.GetFont(self, 
'main', 'EditorWindow') returning a size of 0.  Could you post the result of 
running the following for the bad case?

import tkinter as tk
from tkinter.font import Font
root=tk.Tk()
f = Font(name='TkFixedFont', exists=True, root=root)
print(Font.actual(f))

There is still a question of how fontSize=0 becomes self.fontSize=='', but that 
will not matter when fontSize=0 is prevented.

--

___
Python tracker 

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



[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread Matthew Barnett

Changes by Matthew Barnett :


--
nosy:  -mrabarnett

___
Python tracker 

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



[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fb7628e8dfef by Victor Stinner in branch '3.5':
Fix os.urandom() on Solaris 11.3
https://hg.python.org/cpython/rev/fb7628e8dfef

--
nosy: +python-dev

___
Python tracker 

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



[issue26735] os.urandom(2500) fails on Solaris 11.3

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

> Yes, I've verified that: (...)

Cool, thanks for the bug report and for the check.

It's now fixed. In the meanwhile, you can workaround the issue by limiting 
yourself calls to os.urandom() to 1024 bytes (and then concatenate the result).

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



[issue26718] super.__init__ leaks memory if called multiple times

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

super_init_leaks_2.patch LGTM.

--

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

STINNER Victor added the comment:

Ok, I will update the patch to include an unit test and only apply it
to Python 3.5.

--

___
Python tracker 

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



[issue24557] Refactor LibreSSL / EGD detection

2016-04-12 Thread Paul Moore

Changes by Paul Moore :


--
nosy:  -paul.moore

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

Demur Rumed: can you please rebase your patch? And can you please generate a 
patch without the git format?

--

___
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-12 Thread Martin Panter

Martin Panter added the comment:

I don’t know how it works on Windows, but on Unix in most cases the parent and 
child will share a controlling terminal. Pressing Ctrl+C in the terminal will 
broadcast SIGINT to all processes, parent and child. That is probably why 
os.system() ignores SIGINT.

I doubt the usefulness of building in extra timeouts to send SIGTERM and 
SIGKILL. If the user really cares that much, they can probably design their own 
timeout mechanism. That is why I suggested above to treat the non-timeout mode 
differently.

--

___
Python tracker 

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



[issue26729] Incorrect __text_signature__ for sorted

2016-04-12 Thread Martin Panter

Martin Panter added the comment:

Patch 3 looks okay to me.

--

___
Python tracker 

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



[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread STINNER Victor

New submission from STINNER Victor:

A subprocess.Popen object contains many resources: pipes, a child process (its 
pid, and an handle on Windows), etc.

IMHO it's not safe to rely on the destructor to release all resources. I would 
prefer to release resources explicitly. For example, use proc.wait() or "with 
proc:".

Attached patch emits a ResourceWarning in Popen destructor if the status of the 
child process was not read yet.

The patch changes also _execute_child() to set the returncode on error, if the 
child process raised a Python exception. It avoids to emit a ResourceWarning on 
this case.

The patch fixes also unit tests to release explicitly resources. 
self.addCleanup(p.stdout.close) is not enough: use "with proc:" instead.

TODO: fix also the Windows implementation of _execute_child().

--
components: Library (Lib)
messages: 263281
nosy: haypo, martin.panter, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: subprocess.Popen should emit a ResourceWarning in destructor if the 
process is still running
type: resource usage
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



[issue26732] multiprocessing sentinel resource leak

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

I confirm the issue with Python 3.6 on Linux.

File descriptors of the parent process:

haypo@selma$ ls -l /proc/31564/fd/
lrwx--. 1 haypo haypo 64 13 avril 00:55 0 -> /dev/pts/0
lrwx--. 1 haypo haypo 64 13 avril 00:55 1 -> /dev/pts/0
lr-x--. 1 haypo haypo 64 13 avril 00:55 10 -> pipe:[697354]
lr-x--. 1 haypo haypo 64 13 avril 00:55 11 -> pipe:[697355]
lr-x--. 1 haypo haypo 64 13 avril 00:55 12 -> pipe:[697356]
lrwx--. 1 haypo haypo 64 13 avril 00:54 2 -> /dev/pts/0
lr-x--. 1 haypo haypo 64 13 avril 00:55 3 -> pipe:[697347]
lr-x--. 1 haypo haypo 64 13 avril 00:55 4 -> pipe:[697348]
lr-x--. 1 haypo haypo 64 13 avril 00:55 5 -> pipe:[697349]
lr-x--. 1 haypo haypo 64 13 avril 00:55 6 -> pipe:[697350]
lr-x--. 1 haypo haypo 64 13 avril 00:55 7 -> pipe:[697351]
lr-x--. 1 haypo haypo 64 13 avril 00:55 8 -> pipe:[697352]
lr-x--. 1 haypo haypo 64 13 avril 00:55 9 -> pipe:[697353]

File descriptors of the first child process:

haypo@selma$ ls -l /proc/31565/fd/
lrwx--. 1 haypo haypo 64 13 avril 00:54 0 -> /dev/pts/0
lrwx--. 1 haypo haypo 64 13 avril 00:54 1 -> /dev/pts/0
lrwx--. 1 haypo haypo 64 13 avril 00:54 2 -> /dev/pts/0
lr-x--. 1 haypo haypo 64 13 avril 00:54 3 -> /dev/null
l-wx--. 1 haypo haypo 64 13 avril 00:54 4 -> pipe:[697347]

File descriptors of the second child process:

haypo@selma$ ls -l /proc/31566/fd/
lrwx--. 1 haypo haypo 64 13 avril 00:54 0 -> /dev/pts/0
lrwx--. 1 haypo haypo 64 13 avril 00:54 1 -> /dev/pts/0
lrwx--. 1 haypo haypo 64 13 avril 00:54 2 -> /dev/pts/0
lr-x--. 1 haypo haypo 64 13 avril 00:54 3 -> pipe:[697347]
lr-x--. 1 haypo haypo 64 13 avril 00:54 4 -> /dev/null
l-wx--. 1 haypo haypo 64 13 avril 00:54 5 -> pipe:[697348]

(...)

File descriptors of the last child process:

haypo@selma$ ls -l /proc/31574/fd/
lrwx--. 1 haypo haypo 64 13 avril 00:57 0 -> /dev/pts/0
lrwx--. 1 haypo haypo 64 13 avril 00:57 1 -> /dev/pts/0
lr-x--. 1 haypo haypo 64 13 avril 00:57 10 -> pipe:[697354]
lr-x--. 1 haypo haypo 64 13 avril 00:57 11 -> pipe:[697355]
lr-x--. 1 haypo haypo 64 13 avril 00:57 12 -> /dev/null
l-wx--. 1 haypo haypo 64 13 avril 00:57 13 -> pipe:[697356]
lrwx--. 1 haypo haypo 64 13 avril 00:54 2 -> /dev/pts/0
lr-x--. 1 haypo haypo 64 13 avril 00:57 3 -> pipe:[697347]
lr-x--. 1 haypo haypo 64 13 avril 00:57 4 -> pipe:[697348]
lr-x--. 1 haypo haypo 64 13 avril 00:57 5 -> pipe:[697349]
lr-x--. 1 haypo haypo 64 13 avril 00:57 6 -> pipe:[697350]
lr-x--. 1 haypo haypo 64 13 avril 00:57 7 -> pipe:[697351]
lr-x--. 1 haypo haypo 64 13 avril 00:57 8 -> pipe:[697352]
lr-x--. 1 haypo haypo 64 13 avril 00:57 9 -> pipe:[697353]

--
nosy: +haypo

___
Python tracker 

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



[issue26731] subprocess on windows leaks stdout/stderr handle to child process when stdout/stderr overridden

2016-04-12 Thread STINNER Victor

Changes by STINNER Victor :


--
type:  -> resource usage

___
Python tracker 

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



[issue26731] subprocess on windows leaks stdout/stderr handle to child process when stdout/stderr overridden

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

The PEP 446 fixes the issue on UNIX for file descriptors, but you are right, 
there is still an issue with inheritable Windows handles. By default, Windows 
handles are not inheritable, but subprocess requires to make stdout and stderr 
pipes inheritable.

See:
https://www.python.org/dev/peps/pep-0446/#only-inherit-some-handles-on-windows

See also the issue #19764: "subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST 
with STARTUPINFOEX on Windows Vista".

--
nosy: +haypo

___
Python tracker 

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



[issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista

2016-04-12 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type: enhancement -> resource usage

___
Python tracker 

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




[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

Raymond: Do you have an example to trigger the issue?

--
nosy: +haypo
status: pending -> open

___
Python tracker 

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



[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread Martin Panter

Martin Panter added the comment:

Did you forget to send the patch?

One potential problem is how to provide for people who really want to let the 
child continue to run in the background or as a daemon without waiting for it, 
even if the parent exits. Perhaps a special method proc.detach() or whatever?

--

___
Python tracker 

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



[issue26624] Windows hangs in call to CRT setlocale()

2016-04-12 Thread Jeremy Kloth

Jeremy Kloth added the comment:

It seems that the updated UCRT debug runtime has indeed solved the issue.

I suggest that this issue remains open pending an update to the devguide for 
required settings for installing VS2015 with the updated runtime (see 
msg262672).  I have no idea if the VC Build Tools 2015 installs the needed 
files, so that would need to be checked on a clean machine (all of mine have 
VS2015 installed).

--

___
Python tracker 

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



[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

> Did you forget to send the patch?

Right :-)

--
keywords: +patch
Added file: http://bugs.python.org/file42448/subprocess_res_warn.patch

___
Python tracker 

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



[issue26741] subprocess.Popen should emit a ResourceWarning in destructor if the process is still running

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

> One potential problem is how to provide for people who really want to let the 
> child continue to run in the background or as a daemon without waiting for 
> it, even if the parent exits. Perhaps a special method proc.detach() or 
> whatever?

Maybe my heuristic to decide if ResourceWarning must be emitted is wrong.

If stdout and/or stderr is redirected to a pipe and the process is still alive 
when the destructor is called, it sounds more likely like a bug, because it's 
better to explicitly close these pipes.

If no stream is redirected, yeah, it's ok to pass the pid to a different 
function which will handle the child process. The risk here is not never called 
waitpid() to read the child exit status and so create zombi processes.

For daemons, I disagree: the daemon must use double fork, so the parent will 
quickly see its direct child process to exit. Ignoring the status of the first 
child status is a bug (we must call waitpid().

I have to think about the detach() idea and check if some applications use it, 
or even some parts of the stdlib.

Note: The ResourceWarning idea comes from asyncio.subprocess transport which 
also raises a ResourceWarning. I also had the idea when I read the issue #25942 
and the old issue #12494.

--

___
Python tracker 

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



[issue26491] Defer DECREFs until enum object is in a consistent state for re-entrancy

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

> status: pending -> open

Oh, this change was not intended. I don't know how it occurred.

--
status: open -> pending

___
Python tracker 

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



[issue26624] Windows hangs in call to CRT setlocale()

2016-04-12 Thread STINNER Victor

STINNER Victor added the comment:

Is it possible to log a compilation warning in Python if VS version
contains the bug? Or even make the compilation fails?

--

___
Python tracker 

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



[issue26742] imports in test_warnings changes warnings.filters

2016-04-12 Thread STINNER Victor

New submission from STINNER Victor:

---
$ ./python -Wd -m test -j0 test_warnings
Run tests in parallel using 6 child processes
0:00:01 [1/1] test_warnings
(...)
Warning -- warnings.filters was modified by test_warnings
1 test altered the execution environment:
test_warnings
Total duration: 0:00:02
---

The problem are these two lines in test_warnings/__init__.py:
---
py_warnings = support.import_fresh_module('warnings', blocked=['_warnings'])
c_warnings = support.import_fresh_module('warnings', fresh=['_warnings'])
---

Each fresh "import warnings" calls _processoptions(sys.warnoptions) which can 
change warning filters.

Attached patch saves/restores warnings.filter to fix the resource warning from 
the test suite.

Note: the warning is not emited if tests are run sequentially (without the -jN 
option).

--
files: test_warnings.patch
keywords: patch
messages: 263291
nosy: haypo
priority: normal
severity: normal
status: open
title: imports in test_warnings changes warnings.filters
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42449/test_warnings.patch

___
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-12 Thread Raghu

New submission from Raghu:

Hi, I am trying to import random on a power pc based machine and I see this 
exception. Could you please help me?

root@host# python
Python 2.7.3 (default, Apr  3 2016, 22:31:30)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/random.py", line 58, in 
NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0)
ValueError: math domain error
>>>

--
components: Library (Lib)
messages: 263292
nosy: ragreddy
priority: normal
severity: normal
status: open
title: Unable to import random with python2.7 on power pc based machine
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue26624] Windows hangs in call to CRT setlocale()

2016-04-12 Thread Steve Dower

Steve Dower added the comment:

That's a good idea. I don't know that it's trivial to do, but at build is going 
to be the easiest time. I'll take a look.

--

___
Python tracker 

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



[issue26742] imports in test_warnings changes warnings.filters

2016-04-12 Thread Martin Panter

Martin Panter added the comment:

Hmm your patch is a variation of the first patch in Issue 18383, and Serhiy’s 
comment about not fixing the underlying problem would apply: 
.

I can’t remember all the details now, but it sounds like Alex’s later patch may 
be a slightly more desirable hack :)

--
nosy: +martin.panter

___
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-12 Thread Ma Lin

New submission from Ma Lin:

My OS is MS-Windows 10 X86-64 (Home edition), with the lastest update (now it's 
10586.164).

I have two programs, they occasionally infinite hang.
After a few months observation, I provide these infomation:

1, print() function cause the infinite hang.
2, If it hangs, simply press ENTER key, it goes on without any problem.
3, Both pure-console program and console in Tkinter program have this issue.
4, I tried offical Python 3.4.4 64bit and 3.5.1 64bit, they all have this 
issue. I didn't try other versions because my programs need Python 3.4+.
5, IIRC, the problem was since Windows 10 Threshold 2 (12/Nov/2015), but I'm 
not very sure about this.

--
components: Windows
messages: 263295
nosy: Ma Lin, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: print() function hangs on MS-Windows 10
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



[issue14784] Re-importing _warnings changes warnings.filters

2016-04-12 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> test_warnings modifies warnings.filters when running with "-W 
default"

___
Python tracker 

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



  1   2   >