[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2016-04-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
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



[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> What platform do you get the AttributeError with? Perhaps the function is not 
> well covered in the test suite.

I guess `os.get_terminal_size()` didn't exist on ancient OSes like DOS, OS/2, 
ancient UNIXes. On all supported platforms (including such exotic as old AIX, 
QNX or Minix) it should be defined.

Tests should fail if `os.get_terminal_size()` doesn't exist.

> I think Rietveld doesn't like me because I made it a .diff file, and not a 
> .patch file, but who knows.

I think this is because the patch doesn't contain a revision number.

On Windows `os.get_terminal_size()` can raise ValueError if 
`sys.__stdout__.fileno()` is not one of 0, 1 or 2. It is worth to catch it too. 
An AttributeError is also raised if sys.__stdout__ has no the "fileno" 
attribute (StringIO or None).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23926] skipitem() in getargs.c still supports 'w' and 'w#', and shouldn't

2016-04-18 Thread Joe Jevnik

Joe Jevnik added the comment:

bump

--

___
Python tracker 

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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2016-04-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> This still depends on StringIO.tell() corresponding to the number of code 
> points, which is undocumented (we already disable newline translation in the 
> StringIO). See also Issue 25190.

And doesn't work with Python implementation of StringIO. More general solution 
needs the code like:

pos = file.tell()
tail = file.read()
file.seek(0)
head = file.read()
if tail:
head = head[:-len(tail)]
newfile.write(head)
pos = newfile.tell()  # TextIOWrapper position is opaque
newfile.write(tail)
newfile.seek(pos, 0)

Yet one bad thing with using independent StringIO instead of TextIOWrapper, is 
that saved tell() position becomes not valid after rollover(). I'm going to 
write few tests for cases when file position points not at the end of the 
stream.

--

___
Python tracker 

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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2016-04-18 Thread Martin Panter

Martin Panter added the comment:

According to Issue 12215, the TextIOWrapper.tell() position only includes 
decoder state, not encoder state. So we may be lucky that tell() is 
proportional to the file size. If so my concern about max_size isn’t so 
important. But it still feels like a bad hack.

Maybe another quick fix for this would be to do two writes of the StringIO 
data, and then seek back to the end of the first write:

pos = file.tell()  # StringIO position is in code points
file.seek(0)
newfile.write(file.read(pos))
pos = newfile.tell()  # TextIOWrapper position is opaque
newfile.write(file.read())
newfile.seek(pos, 0)

This still depends on StringIO.tell() corresponding to the number of code 
points, which is undocumented (we already disable newline translation in the 
StringIO). See also Issue 25190.

--

___
Python tracker 

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



[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-18 Thread Emanuel Barry

Emanuel Barry added the comment:

I think Rietveld doesn't like me because I made it a .diff file, and not a 
.patch file, but who knows.

It's a bit of a shot in the dark though, because I can't reproduce an 
environment where `os.get_terminal_size()` doesn't exist. I'm on Windows and 
sometimes compile the latest trunk to play around and find bugs, so it could be 
in one of those times (even though I just tried and it didn't fail).

I think that if `NameError` was to be caught before, it means the function was 
to be "maybe there, maybe not", which could very well still be the case, so it 
makes sense to use the proper exception in that case. I don't see any 
significant drawback to catching AttributeError, anyway.

--

___
Python tracker 

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



[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-18 Thread Martin Panter

Martin Panter added the comment:

The patch looks good to me. The function was originally written to be included 
in the “os” module, hence the NameError. The patch should probably be fine with 
Mercurial, but it looks like the Reitveld review system doesn’t like it :)

What platform do you get the AttributeError with? Perhaps the function is not 
well covered in the test suite.

--
nosy: +martin.panter
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



[issue17233] http.client header debug output format

2016-04-18 Thread Luiz Poleto

Changes by Luiz Poleto :


--
nosy: +luiz.poleto

___
Python tracker 

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



[issue26016] io.TextIOWrapper.tell() report 65bit number when mix readline() + tell()

2016-04-18 Thread Martin Panter

Martin Panter added the comment:

EcmaXp: Do you think there is anything we can do for this? I think the cases 
discussed here are working as intended.

--
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Confirm that the CC license is valid/acceptable with Van L. first. That's
why I pointed at the Apache 2 code, already a known good license. :)

On Mon, Apr 18, 2016, 2:51 PM Christian Heimes 
wrote:

>
> Christian Heimes added the comment:
>
> BLAKE2 is under CC0 1.0 Universal, https://github.com/BLAKE2/libb2
>
> OpenSSL 1.1.0 has no API to set salt, personal, digest length and key
> length (for keyed BLAKE2). I have asked Richard Salz and MJC if they'd
> accept a patch.
>
> Or I could ask Dmitry Chestnykh if he is interested to submit his pyblake2
> module to the stdlib. It's under CC0. It looks pretty good except for his
> macro tricks. I can cope. :)
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue26802] Avoid copy in call_function_var when no extra stack args are passed

2016-04-18 Thread Joe Jevnik

New submission from Joe Jevnik:

When star unpacking positions into a function we can avoid a copy iff there are 
no extra arguments coming from the stack. Syntactically this looks like: 
`f(*args)`

This reduces the overhead of the call by about 25% (~30ns on my machine) based 
on some light profiling of just * unpacking. I can imagine this having a slight 
impact on code that uses this feature in a loop.

The cost is minimal when we need to make the copy because the int != 0 check is 
dwarfed by the allocation. I did not notice a significant change between the 
slow path and the original code.

The macro benchmark suite did not show a difference on my machine but this is 
not much more complex code.

--
components: Interpreter Core
files: call-function-var.patch
keywords: patch
messages: 263702
nosy: ll
priority: normal
severity: normal
status: open
title: Avoid copy in call_function_var when no extra stack args are passed
versions: Python 3.6
Added file: http://bugs.python.org/file42512/call-function-var.patch

___
Python tracker 

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



[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

2016-04-18 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue23251] mention in time.sleep() docs that it does not block other Python threads

2016-04-18 Thread Berker Peksag

Changes by Berker Peksag :


--
status: open -> closed

___
Python tracker 

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



[issue17233] http.client header debug output format

2016-04-18 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +easy
nosy: +berker.peksag
stage:  -> needs patch
versions: +Python 3.5, Python 3.6 -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



[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

2016-04-18 Thread Emanuel Barry

New submission from Emanuel Barry:

`shutil.get_terminal_size()` will sometimes propagate `AttributeError: module 
 has not attribute 'get_terminal_size'` to the caller. The call checks for 
NameError, which makes no sense, so I guess it must be an oversight. Attached 
patch fixes it.

(diff was generated with git, I don't know if it works with Mercurial, but it's 
a trivial change anyway)

--
components: Library (Lib)
files: get_terminal_size.diff
keywords: patch
messages: 263701
nosy: ebarry
priority: normal
severity: normal
stage: patch review
status: open
title: Fix shutil.get_terminal_size() to catch AttributeError
type: behavior
Added file: http://bugs.python.org/file42511/get_terminal_size.diff

___
Python tracker 

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



[issue18591] threading.Thread.run returning a result

2016-04-18 Thread Berker Peksag

Berker Peksag added the comment:

What is your use case? I think this can easily be implemented by subclassing 
the threading.Thread class:

class MyThread(threading.Thread):

def run(self):
# skip try...finally to make the example shorter
result = None
if self._target:
result = self._target(*self._args, **self._kwargs)
return result

We can reopen this if you can share a valid use case. Thanks for the report!

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



[issue11416] netrc module does not handle multiple entries for a single host

2016-04-18 Thread Frew Schmidt

Frew Schmidt added the comment:

This issue is causing a problem in OfflineIMAP.  I wrote a patch that I think 
is a little simpler than the existing one, including tests and docs, though 
honestly I don't care one way or another.  See attached.  Note that the patch 
is for Python 2.7 but it mostly applies to 3.5 just fine.  Any chance we could 
get mine or the other one applied?

Thanks

--
nosy: +Frew Schmidt
versions: +Python 2.7
Added file: http://bugs.python.org/file42510/netrc.patch

___
Python tracker 

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



[issue26730] SpooledTemporaryFile doesn't correctly preserve data for text (non-binary) SpooledTemporaryFile objects when Unicode characters are written

2016-04-18 Thread Martin Panter

Martin Panter added the comment:

I noticed another possible problem with using TextIOWrapper. We call tell() to 
see if a rollover is needed. But I think TextIOWrapper streams can return 
complicated values from tell(), encoding stuff like codec state and buffered 
data in an integer. At the minimum, I think the meaning of max_size has changed 
(code points vs bytes). And perhaps it won’t work very well with some codecs 
that record state in the tell() value.

--

___
Python tracker 

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



[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

No, admin privileges should not be needed to run Command Prompt.  Ditto for 
python if you did not already need same to run IDLE.

--

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Christian Heimes

Christian Heimes added the comment:

BLAKE2 is under CC0 1.0 Universal, https://github.com/BLAKE2/libb2

OpenSSL 1.1.0 has no API to set salt, personal, digest length and key length 
(for keyed BLAKE2). I have asked Richard Salz and MJC if they'd accept a patch.

Or I could ask Dmitry Chestnykh if he is interested to submit his pyblake2 
module to the stdlib. It's under CC0. It looks pretty good except for his macro 
tricks. I can cope. :)

--

___
Python tracker 

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



[issue26754] PyUnicode_FSDecoder() accepts arbitrary iterable

2016-04-18 Thread Philip Jenvey

Philip Jenvey added the comment:

See issue26800 for reasoning to go with #4

--
nosy: +pjenvey

___
Python tracker 

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



[issue26800] Don't accept bytearray as filenames part 2

2016-04-18 Thread Philip Jenvey

New submission from Philip Jenvey:

Basically a reopen of the older issue8485 with the same name. It was decided 
there to drop support for bytearray filenames -- partly because of the 
complexity of handling buffers but it was also deemed to just not make much 
sense.

This regressed or crept back into the posix module with the big path_converter 
changes for 3.3:

https://hg.python.org/cpython/file/ee9921b29fd8/Lib/test/test_posix.py#l411

IMHO this functionality should be deprecated/removed per the original 
discussion, or does someone want to reopen the debate?

The os module docs (and path_converter's own docs) explicitly advertise 
handling of str or bytes, not bytearrays or buffers. Even os.fsencode rejects 
bytearrays/buffers.

Related to issue26754 -- further inconsistencies around filename handling

--
assignee: larry
components: Interpreter Core
keywords: 3.3regression
messages: 263694
nosy: Ronan.Lamy, haypo, larry, pitrou, pjenvey, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Don't accept bytearray as filenames part 2
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Gregory P. Smith

Gregory P. Smith added the comment:

CPython should not attempt make a judgement about the safety of a particular 
function.  We can only document if something has known issues.

We should only include things in the stdlib which are either (a) standard or 
(b) widely used regardless of being standard.  Given that librsync and RAR both 
support BLAKE2 and that it is defined by an RFC, I'd say it should go in.

The reference implementation appears to have Apache 2.0 licensed C code would 
can fall back to when the OpenSSL in use does not include it.

PEP-452 seems to address the necessary API changes.

--
assignee:  -> christian.heimes
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.6

___
Python tracker 

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



[issue26797] Segafault in _PyObject_Alloc

2016-04-18 Thread STINNER Victor

STINNER Victor added the comment:

Usually a "bug in the memory allocator" means a buffer overflow in your
code. Did you check your code using a debug build, PYTHONDEBUG=debug (if
CPython is compiled in release mode), or PYTHONMALLOC=malloc + valgrind?
(The env var requires CPython 3.6)

--

___
Python tracker 

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



[issue26799] gdb support fails with "Invalid cast."

2016-04-18 Thread Thomas

New submission from Thomas:

Trying to use any kind of python gdb integration results in the following error:

(gdb) py-bt
Traceback (most recent call first):
Python Exception  Invalid cast.: 
Error occurred in Python command: Invalid cast.

I have tracked it down to the _type_... globals, and I am able to fix it with 
the following commands:

(gdb) pi
>>> # Look up the gdb.Type for some standard types:
... _type_char_ptr = gdb.lookup_type('char').pointer() # char*
>>> _type_unsigned_char_ptr = gdb.lookup_type('unsigned char').pointer() # 
>>> unsigned char*
>>> _type_void_ptr = gdb.lookup_type('void').pointer() # void*
>>> _type_unsigned_short_ptr = gdb.lookup_type('unsigned short').pointer()
>>> _type_unsigned_int_ptr = gdb.lookup_type('unsigned int').pointer()

After this, it works correctly. I was able to workaround it by making a 
fix_globals that resets the globals on each gdb.Command. I do not understand 
why the originally initialized types are not working properly. It feels like 
gdb-inception trying to debug python within a gdb that debugs cpython while 
executing python code.

I have tried this using hg/default cpython (--with-pydebug --without-pymalloc 
--with-valgrind --enable-shared) 
1) System install of gdb 7.11, linked against system libpython 3.5.1.
2) Custom install of gdb 7.11.50.20160411-git, the debug cpython I am trying to 
debug

--
components: Demos and Tools
messages: 263690
nosy: tilsche
priority: normal
severity: normal
status: open
title: gdb support fails with "Invalid cast."
type: crash
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



[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-18 Thread MICHAEL JACOBSON

MICHAEL JACOBSON added the comment:

Is the command prompt itself admin?
I don't have access to the admin command prompt.

--

___
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-18 Thread Hrvoje Abraham

Hrvoje Abraham added the comment:

IEEE & C/C++ standards allow and explicitly mention it, some people and 
projects are using it, many compilers preserve it...

I believe it's reasonable to support it despite the fact it does not have 
standardized semantic meaning. Maybe one day...

--

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Christian Heimes

Christian Heimes added the comment:

I have SHA-3, SHAKE and BLAKE2s / BLAKE2b on my radar.

PEP 247 and the current API definition of the hashlib module is too limited for 
the new hashing algorithms. It lacks variable output for SHAKE as well as salt 
and personalization for BLAKE. I started to work on PEP 452 while I was working 
on SHA-3 support for Python 3. The PEP is still work-in-progress. I can address 
the needs of BLAKE and submit the PEP to a formal review.

I'm already working on OpenSSL 1.1.0 support for Python. blake will be 
automatically supported with OpenSSL builds. See for yourself:

$ ./python 
Python 3.6.0a0 (default, Apr 18 2016, 21:16:54) 
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.1.0-pre5-dev  xx XXX '
>>> hashlib.new('BLAKE2s256').hexdigest()
'69217a3079908094e11121d042354a7c1f55b6482ca1a51e1b250dfd1ed0eef9'


Donald:
I love to add SHA-3 support to Python. After all I had a working patch for 
SHA-3 before NIST changed the padding. Now my old patch is worthless. The new 
reference implementations are either too complicated (spread across like twenty 
files for various optimizations) or are one-shot implementations. I'm still 
looking for a good implementation that supports incremental updates, copy and 
SHAKE at the same time.

--

___
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-18 Thread Mark Dickinson

Mark Dickinson added the comment:

This StackOverflow answer from one of the IEEE 754 committee members is highly 
relevant here:

http://stackoverflow.com/a/21350299/270986

--

___
Python tracker 

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



[issue26796] BaseEventLoop.run_in_executor shouldn't specify max_workers for default Executor

2016-04-18 Thread Guido van Rossum

Guido van Rossum added the comment:

LGTM!

--

___
Python tracker 

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



[issue26796] BaseEventLoop.run_in_executor shouldn't specify max_workers for default Executor

2016-04-18 Thread Hans Lawrenz

Hans Lawrenz added the comment:

New patch attached. Includes comments and a note in the documentation.

The documentation note is inside a versionchanged:: 3.5 block. Should this be 
more specific about the version it changed in? It could be confusing for 
someone using a version of 3.5 that doesn't have the change.

Contributor form is signed.

Thanks!

--
Added file: 
http://bugs.python.org/file42509/run_in_executor_max_workers_with_docs.patch

___
Python tracker 

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



[issue26779] pdb continue followed by an exception in the same frame shows incorrect frame linenumber

2016-04-18 Thread Sriram Rajagopalan

Changes by Sriram Rajagopalan :


Removed file: http://bugs.python.org/file42486/bdbfix.patch

___
Python tracker 

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



[issue26779] pdb continue followed by an exception in the same frame shows incorrect frame linenumber

2016-04-18 Thread Sriram Rajagopalan

Changes by Sriram Rajagopalan :


Added file: http://bugs.python.org/file42508/bdbfix.patch

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +christian.heimes, gregory.p.smith

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Donald Stufft

Donald Stufft added the comment:

> Right now all the hashlib algorithms are backed by OpenSSL.

As far as I know, hashlib ships it's own implementations of anything that is a 
guaranteed algorithms (currently md5, sha1, and sha2, presumably sha3 too once 
that gets added).

So I guess one question is whether we want to guarantee the existence of blake2 
or not.

--

___
Python tracker 

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



[issue26797] Segafault in _PyObject_Alloc

2016-04-18 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Alex Gaynor

Alex Gaynor added the comment:

Right now all the hashlib algorithms are backed by OpenSSL. OpenSSL 1.1.0 will 
have blake2, so perhaps the right move is just to wait for that to drop in a 
few weeks?

Sadly many users with old OpenSSL's still won't have blake2, but pretty quickly 
Windows and OS X users will get blake2!

--
nosy: +alex

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Zooko Wilcox-O'Hearn

Zooko Wilcox-O'Hearn added the comment:

Oh, just to be clear, I didn't mean to imply that BLAKE2 is _less_ safe than 
SHA-3. My best estimate is that BLAKE2 and SHA-3 are equivalently safe, and 
that either of them is safer than SHA-2, SHA-1, or MD5.

--

___
Python tracker 

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



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

2016-04-18 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



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

2016-04-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6ef3d77b3c27 by Berker Peksag in branch 'default':
Issue #26755: Clarify when version{added,changed} directives should be used in 
docs
https://hg.python.org/devguide/rev/6ef3d77b3c27

--
nosy: +python-dev

___
Python tracker 

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



[issue26798] add BLAKE2 to hashlib

2016-04-18 Thread Zooko Wilcox-O'Hearn

New submission from Zooko Wilcox-O'Hearn:

(Disclosure: I'm one of the authors of BLAKE2.)

Please include BLAKE2 in hashlib. It well-suited for hashing long inputs (e.g. 
files), because it is substantially faster than SHA-3, SHA-2, SHA-1, or MD5 
while also being safer than SHA-2, SHA-1, or MD5.

BLAKE2 and/or its relatives, BLAKE, ChaCha20, and Salsa20, have gotten 
extensive cryptographic peer review.

It is widely used in modern applications and widely supported in modern crypto 
libraries (https://en.wikipedia.org/wiki/BLAKE_%28hash_function%29#BLAKE2_uses).

Here is the official reference implementation: https://github.com/BLAKE2

Here are some Python modules (wrappers or implementations):
 * https://github.com/buggywhip/blake2_py
 * https://github.com/dchest/pyblake2
 * https://github.com/darjeeling/python-blake2

--
components: Library (Lib)
messages: 263679
nosy: Zooko.Wilcox-O'Hearn, dstufft
priority: normal
severity: normal
status: open
title: add BLAKE2 to hashlib

___
Python tracker 

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



[issue26797] Segafault in _PyObject_Alloc

2016-04-18 Thread Yury Selivanov

New submission from Yury Selivanov:

I'm working on an implementation of asyncio event loop on top of libuv [1].  
One of my tests crashes on Mac OS X with a segfault [2].  The problem is that 
it's not consistent -- looks like it depends on size of uvloop so binary, 
or/and amount of objects allocated in program.

I can't reproduce the problem on a debug build, or write a test for it, it is 
really a weird edge-case.  But I'm certain that we have a bug in our memory 
allocator.

Here's a screenshot of crash log [3], and here's an lldb disassembly of crash 
location [4].

Now, what's going on in [2] is:
1. uvloop sets a sigint signal handler the moment it starts the loop
2. uvloop start to execute a coroutine, which blocks on a long "time.sleep(..)" 
call
3. sigint handler receives a SIGINT and calls PyErr_SetInterrupt
4. CPython interrupts the code, KeyboardInterrupt is instantiated and raised
5. CPython starts to render the traceback to print it to stderr, and this is 
where it tries to allocate some object, and this is where we hit a bad-access 
in _PyObject_Alloc.

I'd really appreciate any ideas on what's going on here and how we can fix this.


[1] https://github.com/magicstack/uvloop
[2] https://github.com/MagicStack/uvloop/blob/v0.4.6/tests/test_signals.py#L14
[3] http://imgur.com/6GcE92X
[4] https://gist.github.com/1st1/b46f3702aeb1b57fe4ad32b19ed63c3f

--
messages: 263678
nosy: haypo, ned.deily, serhiy.storchaka, yselivanov
priority: normal
severity: normal
stage: test needed
status: open
title: Segafault in _PyObject_Alloc
type: crash
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-18 Thread Mark Dickinson

Changes by Mark Dickinson :


--
type: behavior -> enhancement

___
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-18 Thread Mark Dickinson

Mark Dickinson added the comment:

> Looks like the sign bit is off (0) in 2.7.

Yep, that looks like issue 22590. It's "fixed" in Python 3, and I don't think 
it's worth changing in Python 2.

About this issue (sign in repr of NaN): sorry, but I'm unconvinced. :-)

>From the standpoint of IEEE 754, the only part that's really relevant is 
>section 5.12 ("Details of conversion between floating-point data and external 
>character sequences"), and there's nothing in that section indicating that a 
>sign is either recommended or required. The most relevant part is this one:

"""
Conversion of a quiet NaN in a supported format to an external character 
sequence shall produce a language-defined one of “nan” or a sequence that is 
equivalent except for case (e.g., “NaN”), with an optional preceding sign. 
(This standard does not interpret the sign of a NaN.)
"""

Yes, it's true that copysign copies the sign bit, but I don't see the leap from 
there to saying that the *repr* of a NaN should include it. total_order doesn't 
really seem relevant here, since Python doesn't implement it, and if it were 
implemented that implementation would almost certainly not be via the repr.

To your catan example: Python follows Annex G of the C99 specification for its 
cmath functions. catan is specified in terms of catanh, and the relevant line 
there is:
"""
catanh(NaN + i∞) returns ±0 + iπ /2 (where the sign of the real part of the 
result is unspecified).
"""
Note that the sign of the zero is unspecified here. There's no part of Annex G 
that introduces any dependence on the sign of a NaN. So no, unlike the sign of 
a zero, the sign of a NaN does *not* play a role in selecting which side of a 
branch cut an input to a complex function lies on. (The branch cuts for 
cmath.atan are both on the imaginary axis, with real part 0; while it's not 
really clear what kind of topology applies to a C99-style extended complex 
plane, it would be a stretch to regard inf +/- iNaN as being anywhere on or 
near that branch cut.)

The roundtrip argument doesn't really hold water either: a quiet NaN has 52 
extra bits of information - a sign bit and a 51-bit payload; if we were 
attempting to roundtrip the bits, we'd need to include the payload information 
too. I don't see that it's any more important to distinguish NaNs with 
different signs than to distinguish NaNs with different payloads.

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

Sure, and clang on OS X produces "nan" for the same source.

> It is reasonable to assume some will need to preserve it.

Maybe, but I've read and worked with a lot of numerical code over the last two 
and a half decades, and I have yet to see any whose correctness depends on 
interpreting the sign of a NaN. Access to the sign bit of a NaN is a rare need, 
and not something that needs be included in the repr. For those who really do 
need it for some kind of custom use-case, it's not hard to use copysign to 
extract it.

In sum, I don't see any benefit to adding the sign, and there's an obvious 
drawback in the form of code breakage (in doctests, for example).

--

___
Python tracker 

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



[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

0. OK, 2.7.5 came out in 2013 May, after the 2.7 backport.  Kristján, you did 
the backport.  Do you have any idea about this?

1. Open a Command Prompt window, the command line console.  For Win 7, it can 
be found find it on the Start menu under Admin or something or started on the 
run line with 'cmd.exe'.  You should learn how to get the console.

On the command line, after the ...> prompt, enter "python patth/to/Skier.py".

Or, maybe, find Skier.py in Windows Explorer, and either double click or 
right-click and select "Run".  (I am not sure if this works with 2.7.5 on 
Vista.)

--
keywords: +3.4regression
nosy: +kristjan.jonsson

___
Python tracker 

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



[issue26615] Missing entry in WRAPPER_ASSIGNMENTS in update_wrapper's doc

2016-04-18 Thread Berker Peksag

Berker Peksag added the comment:

__qualname__ was added to WRAPPER_ASSIGNMENTS in 963e98f5ad31 (issue 13544).

Thanks for the patch!

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



[issue26615] Missing entry in WRAPPER_ASSIGNMENTS in update_wrapper's doc

2016-04-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 11d8f5d1968d by Berker Peksag in branch '3.5':
Issue #26615: Add missing __qualname__ entry to functools.update_wrapper() docs
https://hg.python.org/cpython/rev/11d8f5d1968d

New changeset ee9921b29fd8 by Berker Peksag in branch 'default':
Issue #26615: Add missing __qualname__ entry to functools.update_wrapper() docs
https://hg.python.org/cpython/rev/ee9921b29fd8

--
nosy: +python-dev

___
Python tracker 

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



[issue22873] Re: SSLsocket.getpeercert - return ALL the fields of the certificate.

2016-04-18 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> ssl.getpeercert() should include extensions

___
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-18 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

This patch is for CPython 3, and if it looks good I will post also the CPython 
2 version.

--

___
Python tracker 

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



[issue26796] BaseEventLoop.run_in_executor shouldn't specify max_workers for default Executor

2016-04-18 Thread Guido van Rossum

Guido van Rossum added the comment:

There should at least be a comment at the definition of _MAX_WORKERS that it's 
only used on Python 3.4 and before.

Maybe a note in the docs about the default executor would also be useful.

Otherwise this is exactly what I had in mind -- thanks!

PS. Could you sign a contributor form online
https://www.python.org/psf/contrib/contrib-form/

--

___
Python tracker 

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



[issue26796] BaseEventLoop.run_in_executor shouldn't specify max_workers for default Executor

2016-04-18 Thread Hans Lawrenz

Hans Lawrenz added the comment:

Thanks, that makes sense. I've attached a patch with a version check.

--
Added file: 
http://bugs.python.org/file42507/run_in_executor_max_workers_vcheck.patch

___
Python tracker 

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



[issue26796] BaseEventLoop.run_in_executor shouldn't specify max_workers for default Executor

2016-04-18 Thread Guido van Rossum

Guido van Rossum added the comment:

I like this idea for 3.5 and later. I know this is a pain, but I would like the 
code to have a version check so that the identical code can still be used in 
Python 3.3 and 3.4. We go through great lengths to keep the asyncio package 
compatible with those versions so that we can occasionally push a version out 
to PyPI for 3.3 and 3.4 users. If the versions diverge we would be unable to 
keep track of other bug fixes.

--

___
Python tracker 

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



[issue26796] BaseEventLoop.run_in_executor shouldn't specify max_workers for default Executor

2016-04-18 Thread Hans Lawrenz

New submission from Hans Lawrenz:

In issue 21527  the 
concurrent.futures.ThreadPoolExecutor was changed to have a default value for 
max_workers. When asyncio.base_events.BaseEventLoop.run_in_executor creates a 
default ThreadPoolExecutor it specifies a value of 5 for max_workers, 
presumably because at the time it was written ThreadPoolExecutor didn't have a 
default for max_workers. This is confusing because on reading the documentation 
for ThreadPoolExecutor one might assume that the default specified there is 
what will be used if a default executor isn't supplied via 
BaseEventLoop.set_default_executor.

I propose that BaseEventLoop.run_in_executor be changed to not supply a default 
for max_workers. If this isn't acceptable, a note ought to be put in the 
run_in_executor documentation.

--
components: asyncio
files: run_in_executor_max_workers.patch
keywords: patch
messages: 263669
nosy: Hans Lawrenz, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: BaseEventLoop.run_in_executor shouldn't specify max_workers for default 
Executor
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file42506/run_in_executor_max_workers.patch

___
Python tracker 

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



[issue26795] Fix PEP 344 Python version

2016-04-18 Thread SilentGhost

SilentGhost added the comment:

I think the note at the top makes it perfectly clear that PEP 344 is superseded 
by PEP 3134 which has correct Python version.

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



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

2016-04-18 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Hello,

You can find a patch for this issue attached. Basically, since LTO needs LD 
flags when used, I modified the makefile template file and the test to push the 
flags up to the sysconfig module.

--
keywords: +patch
Added file: http://bugs.python.org/file42504/issue26787.patch

___
Python tracker 

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



[issue26795] Fix PEP 344 Python version

2016-04-18 Thread Marat Sharafutdinov

New submission from Marat Sharafutdinov:

Should be 3.0 instead of 2.5

--
assignee: docs@python
components: Documentation
files: pep-0344-version.patch
keywords: patch
messages: 263667
nosy: decaz, docs@python
priority: normal
severity: normal
status: open
title: Fix PEP 344 Python version
type: enhancement
Added file: http://bugs.python.org/file42505/pep-0344-version.patch

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

Martin Panter added the comment:

Closing this as a duplicate of Issue 15994, where I have proposed a patch to 
add a note for RawIOBase.write(), and call memoryview.release() when the method 
returns.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> memoryview to freed memory can cause segfault

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

Martin Panter added the comment:

I think idea 2 (error if memoryview not released) would not work. It would rely 
on garbage collection, which is not always immediate. E.g. if the memoryview 
were kept alive by a reference cycle, it may not immediately be released. I 
don’t think idea 3 is worthwhile, because the memoryview API does not seem 
designed for this use case, and it would not be 100% consistent anyway.

So that leaves my first idea, to call view.release() when readinto(), etc, 
return. This should avoid the crash and data loss problems in some common 
cases. It is implemented in release-view.patch, along with some notes.

--
components: +Unicode
keywords: +patch
nosy: +ezio.melotti, haypo
stage:  -> patch review
Added file: http://bugs.python.org/file42503/release-view.patch

___
Python tracker 

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



[issue8027] distutils fail to determine c++ linker with unixcompiler if using ccache

2016-04-18 Thread Erik Bray

Erik Bray added the comment:

I'm also inclined to agree that the buggy code (and it *is* buggy even if it 
was meant to fix something originally) should be removed outright.  Nobody can 
point to a real world issue that it fixes anymore, yet we can point to real 
world consequences caused by this bug still.

However, I could also agree that this should come with better support for 
CXXFLAGS and CXXLINK.  It's no wonder these variables are ignored by 
CPython--it doesn't use any c++.  That said, extension module compilation is 
tied, through distutils, to CPython. And there are plenty of c++ extension 
modules in the wild that are affected.  So it's worth addressing how these 
variables are used--or rather not used properly--by distutils.

I'd be happy to take a look at that if that sounds like a good approach?  
Otherwise I'd push for accepting some versions of the existing patches by 
Joshua.J.Cogliati that remove the buggy code.

--

___
Python tracker 

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



[issue8027] distutils fail to determine c++ linker with unixcompiler if using ccache

2016-04-18 Thread Erik Bray

Changes by Erik Bray :


--
nosy: +erik.bray

___
Python tracker 

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



[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-18 Thread MICHAEL JACOBSON

MICHAEL JACOBSON added the comment:

0. I have Python 2.7.5
1. I don't know what you mean.
2. It fails right when I run it.
IDLE stands for Python's Integrated DeveLopment Environment
I am running IDLE / Python on a Windows Vista, Service pack 2

--

___
Python tracker 

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



[issue26657] Directory traversal with http.server and SimpleHTTPServer on windows

2016-04-18 Thread Martin Panter

Martin Panter added the comment:

Thanks for the report and the patch.

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



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

2016-04-18 Thread Steven Adams

Steven Adams added the comment:

Ok but the question still remains, why does it only happen on py3.4+??

--

___
Python tracker 

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



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2016-04-18 Thread Wolfgang Maier

Wolfgang Maier added the comment:

ping?

Just ran into this issue on OS X El Capitan with Region set to Germany and 
Language to English. Just as Ned pointed out 2 years ago, this results in 
LC_CTYPE set to 'UTF-8' in the terminal and docutils still can't cope with it.

--
nosy: +wolma

___
Python tracker 

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



[issue26777] test_asyncio: test_timeout_disable() fails randomly

2016-04-18 Thread STINNER Victor

STINNER Victor added the comment:

The same test failed one more time, I pushed a fix.

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



[issue26777] test_asyncio: test_timeout_disable() fails randomly

2016-04-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 730a95c2d38f by Victor Stinner in branch '3.5':
Fix test_asyncio.test_timeout_disable()
https://hg.python.org/cpython/rev/730a95c2d38f

--
nosy: +python-dev

___
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-18 Thread Xiang Zhang

Xiang Zhang added the comment:

I should not make more noise after realizing it's matter of thread and process. 
Sorry. :-( Except this one. :-)

--

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

STINNER Victor added the comment:

Hum, I should elaborate my explanation :-) os.fork() removes all threads except 
of the current thread. It's clearly stated in the fork manual page, but the 
Python os.fork() doesn't say anything about threads.
https://docs.python.org/dev/library/os.html#os.fork

Short example:
---
import os, threading, time

t = threading.Thread(target=time.sleep, args=(3.0,))
t.start()

print("First process", threading.enumerate())

pid = os.fork()
if pid != 0:
os.waitpid(pid, 0)
else:
print("Child process", threading.enumerate())
---

Output:
---
First process [<_MainThread(MainThread, started 140737353955072)>, 
]
Child process [<_MainThread(MainThread, started 140737353955072)>]
---

The thread is removed in the child process.

Again, *don't create threads before fork*. More generally, don't create any 
resource before fork: don't open files, don't create locks, don't open a 
connection to a database, don't start an event loop, etc.

--

___
Python tracker 

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



[issue26794] curframe can be None in pdb.py

2016-04-18 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +georg.brandl

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

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
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-18 Thread SilentGhost

SilentGhost added the comment:

This seems to be only triggered when moving a symlink into its destination. 
Assumption in the code is that when _samefile returns True, it must be due to 
case-insensitive filesystem, rather than this edge case.

--
nosy: +SilentGhost, tarek
type:  -> behavior
versions: +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



[issue26657] Directory traversal with http.server and SimpleHTTPServer on windows

2016-04-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8054a68dfce2 by Martin Panter in branch '3.5':
Issue #26657: Fix Windows directory traversal vulnerability with http.server
https://hg.python.org/cpython/rev/8054a68dfce2

New changeset 5d8042ab3361 by Martin Panter in branch 'default':
Issue #26657: Merge http.server fix from 3.5
https://hg.python.org/cpython/rev/5d8042ab3361

New changeset 8aa032b26552 by Martin Panter in branch '2.7':
Issue #26657: Fix SimpleHTTPServer Windows directory traversal vulnerability
https://hg.python.org/cpython/rev/8aa032b26552

--
nosy: +python-dev

___
Python tracker 

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



[issue26794] curframe can be None in pdb.py

2016-04-18 Thread Jacek Pliszka

New submission from Jacek Pliszka:

In /usr/lib64/python2.7/pdb.py in
Pdb.default there is line:

globals = self.curframe.f_globals

curframe can be None so the line should be replaced by:

globals = getattr(self.curframe, "f_globals", None) if hasattr(self, 
'curframe') else None

or something should be done in different way in setup

--
components: Library (Lib)
messages: 263652
nosy: Jacek.Pliszka
priority: normal
severity: normal
status: open
title: curframe can be None in pdb.py
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



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

2016-04-18 Thread Xiang Zhang

Xiang Zhang added the comment:

I write a simple example which behaviour is like Steven's example.

import os
import sys
import threading
import ctypes
import time

def test():
while True:
print(time.time())

_thread = threading.Thread(target=test)

pid = os.fork()
if pid > 0:
sys.exit(0)

_thread.start()

Run this with py3.4 emits one print and then comes fatal error:

[code]$ python3 ctypes_test.py 
1460964519.9721818
[code]$ Fatal Python error: could not acquire lock for <_io.BufferedWriter 
name=''> at interpreter shutdown, possibly due to daemon threads

Thread 0x7f41fdadf700 (most recent call first):
  File "ctypes_test.py", line 9 in test
  File "/usr/lib/python3.4/threading.py", line 868 in run
  File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
  File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap

Current thread 0x7f41ff9a9700 (most recent call first):
^C

Without import ctypes, it's OK.

--

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

STINNER Victor added the comment:

IMHO it's a bad idea to create a thread before forking. I suggest you to not 
create any kind of resource before calling daemonize().

--
nosy: +haypo

___
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-18 Thread Xiang Zhang

Xiang Zhang added the comment:

I am not sure what the real problem is. What I can see now it that it seems 
ctypes affects process fork. If you create the thread after fork, for example, 
in wait, your example works well. But if the thread participates in process 
fork, it fails.

--

___
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-18 Thread Steven Adams

Steven Adams added the comment:

My workaround didn't work either.. We are a number of third party libs 
including flask. As soon as i import flask the issues remains.. Maybe something 
with flask is importing ctypes?

Something aint right..

--

___
Python tracker 

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



[issue26765] Factor out common bytes and bytearray implementation

2016-04-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

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

OK. Here is the first part of the patch. It moves common code and docstrings in 
bytes_methods.c.

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

There were conflicts with existing names stringlib_find and stringlib_rfind.

--
Added file: http://bugs.python.org/file42502/bytes_methods_stage1.patch

___
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-18 Thread Xiang Zhang

Xiang Zhang added the comment:

Sorry. I forgot to take that into consideration. I think now the problem 
appears because of ctypes. Simply import ctypes instead of uuid can also lead 
to your problem.

--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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