[issue29384] Unused beos build scripts

2017-01-28 Thread Senthil Kumaran

Senthil Kumaran added the comment:

@martin, the patch looks good to me. Please go ahead and commit this.

--
nosy: +orsenthil

___
Python tracker 

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



[issue29326] Blank lines in ._pth file are not ignored

2017-01-28 Thread Steve Dower

Steve Dower added the comment:

I haven't had a chance to try the patch (underpth_blank_lines.diff) or apply 
it, but it looks right.

If one of the other core devs gets to apply this before I do, feel free.

Alexey, you don't need to sign a CLA for this fix, but if you're going to 
contribute more then you may want to: 
https://docs.python.org/devguide/committing.html#contributor-licensing-agreements
 It's all online, and it'll help save the core developers from having to 
evaluate whether you need it or not (which I can do, because it comes up often 
for me in my day job, but not everyone has that experience). And thanks for 
this patch!

--

___
Python tracker 

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



[issue29386] select.epoll.poll may behave differently if timeout = -1 vs timeout = None

2017-01-28 Thread Gabriel McManus

New submission from Gabriel McManus:

The select module epoll.poll method takes a "timeout" parameter which is 
documented as having a default value of -1 [1]. If no timeout (or None) is 
passed to epoll.poll, then a value of -1 is passed to the epoll_wait system 
call. But if a timeout of -1 is passed to epoll.poll, then a value of -1000 is 
passed to epoll_wait. This is because the timeout is converted from seconds to 
milliseconds.

Before Python 3.5, if a negative timeout was passed to epoll.poll then -1 was 
passed to epoll_wait [2].

The Linux epoll_wait documentation doesn't specify the behaviour if timeout < 
-1. Linux itself behaves the same for all negative timeouts: never time out. 
But on Illumos, timeout < -1 currently times out immediately, and only timeout 
== -1 never times out [3].

Some code does pass -1 to select.epoll.poll expecting it to never time out. For 
example, selectors.EpollSelector [4].

I suggest restoring the pre-3.5 behaviour: epoll.poll should use -1 if the 
given timeout is negative.

I discovered this because ipython3 uses selectors.EpollSelector on Illumos,
and it was using 100% cpu while waiting for input because epoll_wait was 
returning immediately.

To demonstrate the issue you can run:

strace python3.5 -c 'import select; select.epoll().poll(timeout=-1)' &

On Illumos this completes immediately, and the output contains the -1000 
timeout:

epoll_wait(3, [], 1023, -1000)  = 0

On Linux, it will block. If you then kill the python process with SIGTERM, 
strace should print the interrupted epoll_wait call, revealing the -1000 
timeout:

epoll_wait(3, 
...
299a070, 1023, -100)= -1 EINTR (Interrupted system call)

[1] 
https://github.com/python/cpython/blob/b9e40ed1bcce127893e40dd355087cda7187ac27/Modules/selectmodule.c#L1489
[2] 
https://github.com/python/cpython/commit/02e27d1301ea680dce9c3013010e3befedf9628a
[3] https://github.com/joyent/illumos-joyent/issues/136
[4] 
https://github.com/python/cpython/blob/8228a2b306844a213eddb4fb908c1925840ff67e/Lib/selectors.py#L428

--
components: Extension Modules
messages: 286431
nosy: Gabriel McManus
priority: normal
severity: normal
status: open
title: select.epoll.poll may behave differently if timeout = -1 vs timeout = 
None
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue23980] Documentation for format units starting with 'e' is inconsistent

2017-01-28 Thread Martin Panter

Martin Panter added the comment:

The O! and O& units are in a similar situation. They just use a different font 
and descriptive name, rather than a specific type:

``O!`` (object) [*typeobject*, PyObject \*]
``O&`` (object) [*converter*, *anything*]

Following this lead, you could write:

``es`` (:class:`str`) [*encoding*, char \*buffer]
``et`` (. . .) [*encoding*, char \*buffer]
``es#`` (:class:`str`) [*encoding*, char \*buffer, int buffer_length]
``et#`` (. . .) [*encoding*, char \*buffer, int buffer_length]

The text description should explain what *encoding* is, but it appears it may 
already do that well enough.

--
nosy: +martin.panter

___
Python tracker 

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



[issue29385] Sockets Crashes or Memory Corruption

2017-01-28 Thread Dhiraj

New submission from Dhiraj:

When Python Server receives a string of '/xff' (5 or more) from a page  after 
completing a handshake, the tab immediately crashes.  There are variations of 
this string with other characters mixed in that also cause an immediate close 
of python server.

To reproduce:

1. Run the websockets.py server 
2. Then open websockets.html in browser 

The PY server gets Close/Crash

--
components: Windows
files: REPRO.ZIP
messages: 286429
nosy: Dhiraj_Mishra, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Sockets Crashes or Memory Corruption
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46448/REPRO.ZIP

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks for the patch.  It applies cleanly.  The docs build just fine.  The 
markup looks okay.  The example runs correctly.

Applied and marking as closed.

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b33c3f26eefa by Raymond Hettinger in branch '3.6':
Issue 29310: Document typing.NamedTuple default argument syntax
https://hg.python.org/cpython/rev/b33c3f26eefa

--
nosy: +python-dev

___
Python tracker 

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



[issue29384] Unused beos build scripts

2017-01-28 Thread Martin Panter

New submission from Martin Panter:

Modules/ld_so_beos and Modules/ar_beos are no longer used since Be OS support 
was dropped from the configure script for Python 3:

https://hg.python.org/cpython/diff/a5e984eda45a/configure.in

I propose to also remove the scripts.

--
components: Build
files: beos-scripts.patch
keywords: patch
messages: 286426
nosy: martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Unused beos build scripts
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46447/beos-scripts.patch

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Guido van Rossum

Guido van Rossum added the comment:

Sorry, I'm still sick. You may have to find another core dev to help you.

--

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Is Mariatta responsible for reviewing Documentation submissions?

No, she is a new core developer and this is a good issue for her to do the 
initial review and post any thoughts on the subject.  We've all got to start 
somewhere.

> If so, should I nosy Mariatta in any future documentation issues?

You did everything just right.  Just marking this as a doc patch is sufficient.

--

___
Python tracker 

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



[issue3991] urllib.request.urlopen does not handle non-ASCII characters

2017-01-28 Thread Martin Panter

Martin Panter added the comment:

I’m not really an expert on non-ASCII URLs / IRIs. Maybe it is obvious to other 
people that this is a good general implementation, but for me to thoroughly 
review it I would need time to research the relevant RFCs, other 
implementations, suitability for the URL schemes listed at 
, security implications, 
etc.

One problem problem with using urlunsplit() is it would strip empty URL 
components, e.g. quote_iri("http://example/file#";) -> "http://example/file";. 
See Issue 22852. This is highlighted by the file:///[. . .] → file:/[. . .] 
test case.

FYI Martin Panter and vadmium are both just me, no need to get too excited. :) 
I just updated my settings for Rietveld (code review), so hopefully that is 
more obvious now.

--

___
Python tracker 

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



[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-28 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Cross-posting the link to upstream work on this: 
https://github.com/python/typing/pull/377

--

___
Python tracker 

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



[issue20664] _findLib_crle and _get_soname broken on latest SunOS 5.11

2017-01-28 Thread Martin Panter

Martin Panter added the comment:

There is an Open Indiana buildbot 
, that was passing 
test_ctypes (until the buildbot went offline a few weeks ago). Would it be 
possible to include a regression test case?

Also, in , John said that 
/usr/ccs/bin is a symbolic link to /usr/bin/, so I wonder if this really is a 
problem. Perhaps the symlink does not exist on some OS versions?

Regarding an environment variable for library searching, perhaps that is 
related to Issue 9998 (searched LD_LIBRARY_PATH env. var. on Linux). See also 
Issue 19317, discussing RPATH fom sys.executable.

--
nosy: +martin.panter
stage:  -> patch review
versions: +Python 3.6, Python 3.7 -Python 3.1, 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



[issue23287] ctypes.util.find_library needlessly call crle on Solaris

2017-01-28 Thread Martin Panter

Martin Panter added the comment:

Do you have an opinion of the proposal Shawn?

Judging by John’s “[the constant] is what the system provides, though
users may customize as needed”, it sounds like the patch is more than a bug 
fix. Will it also mean find_library() will no longer search customized library 
directories? I’m not familiar with Solaris, but it seems this may not be 
intended or desired.

Why is this bug marked as “resource usage”?

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

___
Python tracker 

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



[issue29362] regrtest: don't fail immediately if a child does crash

2017-01-28 Thread Ammar Askar

Ammar Askar added the comment:

This patch makes it so that when a child runner crashes during a multiprocess 
test run, it is treated similar to a keyboard interrupt. That is, the currently 
running tests will continue to run and immediately after it will print out a 
summary.

I think the test suite should be interrupted when an interpreter crash happens 
because this indicates a fairly major failure and interrupting the suite brings 
a lot of attention to it.

--
keywords: +patch
nosy: +ammar2
Added file: http://bugs.python.org/file46446/regrtest_crash.diff

___
Python tracker 

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



[issue23287] ctypes.util.find_library needlessly call crle on Solaris

2017-01-28 Thread Shawn

Shawn added the comment:

Could we get someone to evaluate this please?

--
nosy: +swalker

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Thank you!

Guido, I think this is ready to be merged.

--

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Fixed the typo

--
Added file: http://bugs.python.org/file46445/issue29310-3.patch

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-28 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Indeed, this does create an issue. 

The last sentence in the documentation actually specifies where the encoding 
comment can be but doesn't strictly specify it can be on the second line if and 
only if preceded by `#!`.

I'm thinking the last sentence should contain the additional change, that is, 
change it from :

The special encoding comment must be in the first or second line within the 
file.

to:

The special encoding comment must be in the first line, or, if the first 
line is used to create an executable Python script, the second line within the 
file.

linking to 
(https://docs.python.org/3/tutorial/appendix.html#executable-python-scripts) 
accordingly. 

Let's see what Mariatta says about these proposals. Thanks for noticing.

--

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-28 Thread Marco Buttu

Marco Buttu added the comment:

You wrote: "It is also possible to specify a different encoding for source 
files. In order to do this, you can use a special comment line that defines the 
source file encoding::". I think that is not true, because the line have to be 
the first line, or right below a comment (just one, as in the case of the 
shebang). For instance, in this case Python apply the declared coding:

  $ cat foo.py
  # The first line is a comment
  # -*- coding: ascii -*-
  print('è')  # Encoded in UTF-8
  $ python foo.py
 ...
  SyntaxError: encoding problem: ascii


In this case it does not:

  $ cat foo.py
  # The first line is a comment
  # and also the sencond line
  # -*- coding: ascii -*-
  print('è')  # Encoded in UTF-8
  $ python foo.py 
  è

But I think you are right that the current doc is confusing. Maybe yon can 
write something like this: 

"It is also possible to specify a different encoding for source files. In order 
to do this, put one special comment line to define the source file encoding:

# -*- coding: encoding -*-

This coding comment has to be the first line of the file, or the second line in 
case the first one is the #! line."

--
nosy: +marco.buttu

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2017-01-28 Thread Marco Buttu

Marco Buttu added the comment:

In order for the patches to work for every Python version (see #msg284622 ), I 
added a new feature to the Sphinx doctest extension, called pyversion. Starting 
from Sphinx 1.6, it will be possible to specify the Python version in order for 
the example to be tested. For instance, if I run the doctests with Python 3.3, 
then this test will be skipped:

.. doctest::
:pyversion: > 3.4

# Code example

It will be tested only when Sphinx is running on Python > 3.4. My question is: 
what about using this feature in the patches? I am asking this because Sphinx 
1.6 will be released in about 7-10 months, so until then, if we want to use the 
:pyversion: feature we have to build the documentation using the master version 
of Sphinx. Please, let me know

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2017-01-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I agree with Stefan and Serhiy.  Unaligned memoryviews shouldn't trigger a copy 
when hashing.

--
nosy: +pitrou

___
Python tracker 

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



[issue29302] add contextlib.AsyncExitStack

2017-01-28 Thread Vedran Čačić

Vedran Čačić added the comment:

An example from "real life": I recently needed this when implementing a demo of 
dining philosophers using asyncio (when the order of locks should depend on 
comparison of fork ids, not be static). Of course, it wasn't hard to implement 
it directly, but still, it would be nice if I had it in stdlib.

Also, yes, it would probably be nicer if there was only one ExitStack with 
push_async and similar methods.

--
nosy: +veky

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-28 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Hi, Raymond. Is Mariatta responsible for reviewing Documentation submissions? 
If so, should I nosy Mariatta in any future documentation issues?

--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Armin Rigo

Armin Rigo added the comment:

Let's see if the discussion goes anywhere or if this issue remains in limbo for 
the next 7 years.  In the meantime, if I may humbly make a suggestion: whether 
the final decision is to give SyntaxError or change the semantics, one or a few 
intermediate versions with a SyntaxWarning might be a good idea.

--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

> How about fixing CPython to raise SyntaxWarning or even SyntaxError?

I think it is better to just fix the issue, i.e. make comprehensions be 
equivalent to for-loops even if they contain `yield`. (In particular this will 
lead to [(yield i) for i in range(5)] be SyntaxError outside function).

The example of `await` shows that it is possible without leaking the loop 
variable into enclosing scope.

--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Armin Rigo

Armin Rigo added the comment:

Just to add my comment to this 7-years-old never-resolved issue: in PyPy 3.5, 
which behaves like Python 3.x in this respect, I made the following 
constructions give a warning.

def wrong_listcomp():
return [(yield 42) for i in j]
def wrong_gencomp():
return ((yield 42) for i in j)
def wrong_dictcomp():
return {(yield 42):2 for i in j}
def wrong_setcomp():
return {(yield 42) for i in j}

SyntaxWarning: 'yield' inside a list or generator comprehension behaves 
unexpectedly (http://bugs.python.org/issue10544)

The motivation is that none of the constructions above gives the "expected" 
result.  In more details:

- wrong_listcomp() doesn't even return a list at all.  It's possible to have a 
clue about why this occurs, but I would say that it is just plain wrong given 
the ``return [...]`` part of the syntax.  The same is true for wrong_dictcomp() 
and wrong_setcomp().

- wrong_gencomp() returns a generator as expected.  However, it is a generator 
that yields two elements for each i in j: first 42, and then whatever was 
``send()`` into the generator.  I would say that it is in contradiction with 
the general idea that this syntax should give a generator that yields one item 
for each i in j.  In fact, when the user writes such code he might be expecting 
the "yield" to apply to the function level instead of the genexpr level---but 
none of the functions above end up being themselves generators.

For completeness, I think there is no problem with "await" instead of "yield" 
in Python 3.6.

How about fixing CPython to raise SyntaxWarning or even SyntaxError?

--
nosy: +arigo

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

I have found one typo (see Rietveld), otherwise LGTM.

--

___
Python tracker 

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



[issue29366] os.listdir has inconsistent behavior when run on a non-directory

2017-01-28 Thread Eryk Sun

Eryk Sun added the comment:

Python has no specific use for ERROR_PATH_NOT_FOUND (3) and just maps it to 
FileNotFoundError -- like the CRT maps it to ENOENT. Even if we wanted 
listdir() to specially handle this error, given that it's implemented via 
FindFirstFile, there's nothing that can be done after the fact that's not 
vulnerable to race conditions. 

Also, to reiterate this point, getting ERROR_PATH_NOT_FOUND instead of 
ERROR_DIRECTORY (267) when the target is a file seems to be pretty uncommon, 
much more so than I at first thought. I only see it with VirtualBox shared 
folders. I don't see it with Microsoft file systems such as NTFS, FAT32, or 
CDFS.

--

___
Python tracker 

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