[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Anders, the problem is that running subprocess.run(executable) instead of 
subprocess.run([executable]) (where executable is a path to a program) is a 
bug. For example it doesn't work if the path contains spaces. And PR 4329 
encourages making this bug.

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-05 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

I'm sympathetic to the idea that we don't want to carry around these checks, 
but also to the idea that this caused a regression in a micro release and 
that's not cool. Hence the idea that maybe we should keep everything the way it 
is in 3.7, but disable the new constants in 3.6, so that it arrives as part of 
a major release.

OTOH it's been in 3.6 for like 6 weeks already so I guess a lot of the affected 
parties are already working around it.

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-05 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

I suggest closing the issue as "won't fix": checking in runtime for only for 
TCP flags on Windows is a weird exception.
Checking all flags on all supported platforms is impossible.

Client libraries should process such situations themself.

--

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

> out of curiosity, did you actually diagnose a process deadlocked due to this 
> or was it noted via code inspection?

The latter. I noted it while working on another issue. While it was easy to 
trigger a malloc() in child_exec() by e.g. specifying an invalid fd in pass_fds 
for Popen, I haven't tried to arrange a deadlock.

--

___
Python tracker 

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



[issue5594] IDLE: execute stored startup code on each Shell start.

2018-02-05 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Currently, Shell start and restart act differently.  Start can execute one of 
-s file, -c command, or neither (and there are other command line options).  
Restart prints a RESTART separator banner and optionally runs an edit buffer, 
but ignores all or most command-line options.

I would like to try to solve this and related issues by simplifying pyshell so 
that there is a uniform user process startup, rather than initial start and 
later restart.  Shell would always print a START header banner, adjusted 
according to which, if any, pre-defined code it was going to run, run the code, 
and then print a prompt for interactive input.

My hesitation about making -s or -c repeat, expressed on another issue, is that 
someone might want stop repeating with exiting.  I think an adequate solution 
would be a new section of the Shell menu with radio buttons such as () No 
startup, () Start file, and () Start command, with inapplicable choices grayed 
out.

The above should be a separate new issue and a dependency of this one.
===

This issue has 2 parts.

1. Make it possible to run Shell startup code when IDLE is not started from the 
command line, which it usually is not, and without adding a separate startup 
script and icon.  The two subproposals are storing in IDLE's user config either 
a filename (which file could also be used without IDLE) or a code block.  I am 
willing to do both. 

2. Make it possible to run the new Shell startup code each time Shell starts 
without running editor code.  I don't want to do 1. without 2., and I don't 
want to make re-running possibly only for new sources.  I propose that we first 
fix re-running for existing sources, as described above, so that when 1. is 
done after, 2. easily follows.
===

About the patch: You picked a non-trivial issue ;-), and review will not be 
quick.  Could you list the 'other issues'?  Even if they are handled later with 
separate PRs (if not rejected) I want to have them in mind before doing this.  
For instance, they may affect my idea of how we should split the General tab.

I am not sure whether I have ever tested that -s, for instance, works 
correctly.  Certainly not recently.  User code must be exec'ed within the run 
process by run.py code and not run in main's global context by python.  This is 
why I am unsure about using -c, as that should do the latter before run code 
takes over.
===

Editor template code is different issue.  I think it needs separate discussion, 
with consideration of how other editors work.  AFAIK, there is no existing 
issue, so a new one is needed.

My own use case, is for a separate project where most files, but not all, start 
with a template.  Currently with IDLE, I open the template and immediately save 
with the new name.  If I could instead start with a blank and insert the 
template, I could not accidentally overwrite.  With multiple projects, I would 
probably want multiple templates.  The File menu could have a entry such as 
'New, with template'.

I have expected to split the General tab. I was thinking there should be a new 
'Editor' tab, which would seem to be the place for editor template information. 
  I think both template file(s) and a config template block  should be options.
===

For code entry, whether startup code or template, the patch uses a Text widget 
with scrollbar added.  I believe tkinter already has such.  However, I agree 
with Cherniavsky that an IDLE editor would be even better.  However, we really 
need a small editor frame, with no menu, rather than a separate window.  The OK 
and Apply buttons would  'save' the contents.

I have already intended to factor a subclassable editor frame out of 
EditorWindow.  (I have also thought of using a subclass of such as the code 
entry area for Shell.)  Startup and template code would be two other uses.

--
title: IDLE startup configuration -> IDLE: execute stored startup code on each 
Shell start.
versions: +Python 3.8

___
Python tracker 

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



[issue32770] collections.counter examples are misleading

2018-02-05 Thread Anthony Flury

Anthony Flury  added the comment:

Cheryl : 
When you iterate around a counter instance it does return keys in the order 
they are first encountered/inserted - so I agree with you that it is an ordered 
collection from Python 3.7 onwards (although the iteration and the repr are 
ordered in different orders.

--

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
components: +Extension Modules
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset b90c68586e1f2c45c736dd38880f182be267e2ef by Gregory P. Smith 
(Miss Islington (bot)) in branch '3.6':
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) 
(GH-5563)
https://github.com/python/cpython/commit/b90c68586e1f2c45c736dd38880f182be267e2ef


--

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 2bb0bfafb0beb819b7c60d9004382ce6867847c0 by Gregory P. Smith 
(Miss Islington (bot)) in branch '3.7':
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) 
(GH-5562)
https://github.com/python/cpython/commit/2bb0bfafb0beb819b7c60d9004382ce6867847c0


--

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5385

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5386

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset c1e46e94de38a92f98736af9a42d89c3975a9919 by Gregory P. Smith 
(Alexey Izbyshev) in branch 'master':
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560)
https://github.com/python/cpython/commit/c1e46e94de38a92f98736af9a42d89c3975a9919


--

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

out of curiosity, did you actually diagnose a process deadlocked due to this or 
was it noted via code inspection?

this issue has been around since 3.4 and the file descriptor inheritance 
changes from the looks of things.

--

___
Python tracker 

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



[issue32780] ctypes: memoryview gives incorrect PEP3118 format strings for both packed and unpacked structs

2018-02-05 Thread Eric Wieser

Change by Eric Wieser :


--
type:  -> behavior

___
Python tracker 

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



[issue32780] ctypes: memoryview gives incorrect PEP3118 format strings for both packed and unpacked structs

2018-02-05 Thread Eric Wieser

Change by Eric Wieser :


--
keywords: +patch
pull_requests: +5383
stage:  -> patch review

___
Python tracker 

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



[issue32780] ctypes: memoryview gives incorrect PEP3118 format strings for both packed and unpacked structs

2018-02-05 Thread Eric Wieser

New submission from Eric Wieser :

Discovered [here](https://github.com/numpy/numpy/issues/10528)

Consider the following structure, and a memoryview created from it:

class foo(ctypes.Structure):
_fields_ = [('one', ctypes.c_uint8),
('two', ctypes.c_uint32)]
f = foo()
mf = memoryview(f)

We'd expect this to insert padding, and it does:

>>> mf.itemsize
8

But that padding doesn't show up in the format string:

>>> mf.format
'T{ No padding is added when using non-native size and alignment, e.g. with ‘<’, 
> ‘>’

But ctypes doesn't even get it right for packed structs:


class foop(ctypes.Structure):
_fields_ = [('one', ctypes.c_uint8),
('two', ctypes.c_uint32)]
_pack_ = 1
f = foo()
mf = memoryview(f)

The size is what we'd expect:

>>> mf.itemsize
5

But the format is garbage:

>>> mf.format
'B'  # sizeof(byte) == 5!?

--
components: ctypes
messages: 311705
nosy: Eric.Wieser
priority: normal
severity: normal
status: open
title: ctypes: memoryview gives incorrect PEP3118 format strings for both 
packed and unpacked structs
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32779] urljoining an empty query string doesn't clear query string

2018-02-05 Thread Paul Fisher

New submission from Paul Fisher :

urljoining with '?' will not clear a query string:

ACTUAL:
>>> import urllib.parse
>>> urllib.parse.urljoin('http://a/b/c?d=e', '?')
'http://a/b/c?d=e'

EXPECTED:
'http://a/b/c' (optionally, with a ? at the end)

WhatWG's URL standard expects a relative URL consisting of only a ? to replace 
a query string:

https://url.spec.whatwg.org/#relative-state

Seen in versions 3.6 and 2.7, but probably also affects later versions.

--
components: Library (Lib)
messages: 311704
nosy: Paul Fisher
priority: normal
severity: normal
status: open
title: urljoining an empty query string doesn't clear query string
type: behavior
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith

___
Python tracker 

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



[issue32778] Hi

2018-02-05 Thread Steven D'Aprano

Change by Steven D'Aprano :


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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2018-02-05 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset 22864bc8e4a076bbac748ccda6c27f1ec41b53e7 by Alexander Belopolsky 
(Paul Ganssle) in branch 'master':
Add What's new entry for datetime.fromisoformat (#5559)
https://github.com/python/cpython/commit/22864bc8e4a076bbac748ccda6c27f1ec41b53e7


--

___
Python tracker 

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



[issue32770] collections.counter examples are misleading

2018-02-05 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

You know, I'm not sure if I had ever seen that example before.  When you click 
Counter at the top of the page, it goes right to the class definition, which is 
past the example.

Having said that, I really like the example.  Until now, I didn't realize what 
Raymond said above about Counters (that the core ability is to write c['x'] += 
1 without a KeyError).  So, thanks to this report, I learned that today!

One thing that did surprise me in the example is that I expected the repr to be 
in insertion order in 3.7.  The class description says 'It is an unordered 
collection where elements are stored as dictionary keys' and I was wondering if 
that was still true since dicts now have a guaranteed order.  I tried it on the 
example, which still printed Counter({'blue': 3, 'red': 2, 'green': 1})!  Of 
course it makes sense after looking at the code because it calls `most_common` 
in the repr, but I hadn't realized that before.  So, two things learned about 
Counter today.   :-)

Anyway, writing this here to ask about the wording regarding 'unordered 
collection'.

Thanks!

--
nosy: +csabella

___
Python tracker 

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



[issue32778] Hi

2018-02-05 Thread REBECCA VICKERS

New submission from REBECCA VICKERS :

Sent from my iPhone

--
messages: 311701
nosy: REBECCAVICKERS000
priority: normal
severity: normal
status: open
title: Hi

___
Python tracker 

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



[issue32767] Mutating a list while iterating: clarify the docs

2018-02-05 Thread Tim Peters

Tim Peters  added the comment:

Some other points to consider:  I don't think this belongs in the `for` 
statement docs at all.  Instead they should merely _note_ that what happens if 
a sequence being iterated over is mutated is up to the sequence iterator.

Then, e.g., the `list` docs should spell out the behavior currently (but, as 
already noted, incompletely) described.  From StackOverflow experience, I may 
be the only person in the world who knows that list behavior here is documented 
under the `for` statement - everyone else gives up after not finding a word 
about it in the `list` docs ;-)

`collections.deque` docs, in contrast, may wish to document the behavior of its 
iterators.  They in fact work hard to raise an exception if a size-changing 
mutation occurs during iteration, but that doesn't appear to be documented.  
It's worth debating whether it should be.

Are there other mutable sequence types in the standard distribution?

--
nosy: +rhettinger

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev

Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +5382
stage:  -> patch review

___
Python tracker 

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



[issue32777] subprocess: child_exec() uses _Py_set_inheritable() which is not async-signal-safe

2018-02-05 Thread Alexey Izbyshev

New submission from Alexey Izbyshev :

_Py_set_inheritable() raises a Python-level exception on error and thus is  not 
async-signal-safe, but child_exec() must use only async-signal-safe functions 
because it's executed between fork() and exec().

Since a non-raising version is already implemented in Python/fileutils.c for 
internal use (set_inheritable), I suggest to simply expose it via another 
public function (similar to _Py_open_noraise(), etc.).

--
components: Library (Lib)
messages: 311699
nosy: izbyshev, vstinner
priority: normal
severity: normal
status: open
title: subprocess: child_exec() uses _Py_set_inheritable() which is not 
async-signal-safe
type: behavior
versions: 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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2018-02-05 Thread Paul Ganssle

Change by Paul Ganssle :


--
pull_requests: +5380, 5381

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2018-02-05 Thread Paul Ganssle

Change by Paul Ganssle :


--
pull_requests: +5380

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Anders Lorentsen

Anders Lorentsen  added the comment:

> # runs this weird file
> subprocess.run([bin])

> # Currently an error; if this is implemented, would run
> # /bin/ls, and pass it the -l argument. Refers to something
> # completely different than our .exists() call above.

I do not understand where it is stated that this is the behavior. My 
understanding was that if run() is passed a single argument, it will interpret 
the string "/bin/ls -l" to mean "run the `/bin/ls` program, and pass it one 
argument `-l`, whereas if instead run() is given a list, it will literally 
treat the first element as the program to run, regardless of how many spaces or 
whatever else it contains ... And as such, if `bin` is a Path-like object, this 
issue tries to resolve that
run([bin]) works as excepted, but run(bin) fails horribly.

Sure, I can understand that for strings it may not feel natural how these two 
things are interpreted differently, but if `bin` is a Path-like object, it at 
least feels very natural to me that then it should be run as the program name 
itself (as "paths" does not have arguments).

--

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
nosy: +ned.deily
priority: normal -> release blocker
versions: +Python 3.8

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I agree with both of you at this point.

TODO: Revert the PR and backport that to the 3.7 branch (i'll take care of it)

--
resolution: fixed -> 
stage: resolved -> needs patch

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-05 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'd also ask whether the use case can be satisfied by rebinding __class__ 
instead of __bases__. That's far better defined than replacing the contents of 
the bases list and attempting to dynamically recalculate the MRO.

--

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

I think I agree with Serhiy here... the whole difference between run([a]) and 
run(a) is that in the first case 'a' is treated as a path, and in the second it 
isn't. This distinction long predates pathlib.

Say I have an oddly named binary with an embedded space in its name:

bin = Path("/bin/ls -l")

# Check that this weird file actually exists:
assert bin.exists()

# runs this weird file
subprocess.run([bin])

# Currently an error; if this is implemented, would run
# /bin/ls, and pass it the -l argument. Refers to something
# completely different than our .exists() call above.
subprocess.run(bin)

--
nosy: +njs

___
Python tracker 

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



[issue32776] asyncio SIGCHLD scalability problems

2018-02-05 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

There's two separate issues here: the warning spew because asyncio's internal 
signal handling code starts losing signals when they arrive too quickly, and 
the way the child reaping loop polls all the children on every SIGCHLD, which 
makes reaping N children an O(N**2) operation.

The warning spew is inherent in asyncio's current signal handling design. (BTW, 
Victor, here's an answer to your question in 
https://bugs.python.org/issue30050#msg291533 about whether this overflow can 
happen in real life :-).) It's not *terribly* harmful – losing some SIGCHLDs 
among thousands doesn't matter. It does mean that you could lose other signals 
if they happen to arrive at the same time, e.g. SIGINT and SIGTERM are probably 
ignored while this is happening.

For the O(N**2) issue, I think you can work around it by using some incantation 
involving set_child_watcher and the FastChildWatcher class. These aren't 
documented (maybe someone should document them!) and I don't know the exact 
details off the top of my head, but it is a public interface for making your 
child reaping O(N). (This uses the wait(-1, ...) trick. Unfortunately there are 
arcane technical limitations with signalfd and si_pid that mean they can't 
solve this problem. Something like CLONE_FD would help, but that patch was 
never merged into Linux.)

You might also consider switching to something like uvloop, which has a more 
robust event loop implementation underneath. I haven't checked, but I'm pretty 
sure it'd fix the signal buffer overflow issue, and I doubt they use an O(N**2) 
child reaping algorithm.

--
nosy: +njs, vstinner

___
Python tracker 

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



[issue32642] add support for path-like objects in sys.path

2018-02-05 Thread Jay Yin

Jay Yin  added the comment:

This looks a lot like https://bugs.python.org/issue32446, I'd like to tackle 
this, if we are going through with it.

--
nosy: +jayyin11043

___
Python tracker 

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



[issue32776] asyncio SIGCHLD scalability problems

2018-02-05 Thread holger

New submission from holger :

I intended to use the asyncio framework for building an end-to-end test for our 
software. In the test I would spawn somewhere between 5k to 10k processes and 
have the same number of sockets to manage.

When I built a prototype I ran into some scaling issues. Instead of launching 
our real software I tested it with calls to sleep 30. At some point started 
processes would finish, a SIGCHLD would be delivered to python and then it 
would fail:

 Exception ignored when trying to write to the signal wakeup fd:
 BlockingIOError: [Errno 11] Resource temporarily unavailable

Using strace I saw something like:

send(5, "\0", 1, 0) = -1 EAGAIN (Resource temporarily 
unavailable)
waitpid(12218, 0xbf8592d8, WNOHANG) = 0
waitpid(12219, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG) = 12219
send(5, "\0", 1, 0) = -1 EAGAIN (Resource temporarily 
unavailable)
waitpid(12220, 0xbf8592d8, WNOHANG) = 0
waitpid(12221, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG) = 12221
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12293, si_uid=1001, 
si_status=0, si_utime=0, si_stime=
0} ---
getpid()= 11832
write(5, "\21", 1)  = -1 EAGAIN (Resource temporarily 
unavailable)
sigreturn({mask=[]})= 12221
write(2, "Exception ignored when trying to"..., 64) = 64
write(2, "BlockingIOError: [Errno 11] Reso"..., 61) = 61


Looking at the code I see that si_pid of the signal will be ignored and instead 
wait(2) will be called for all processes. This doesn't seem to scale well 
enough for my intended use case.

I think what could be done is one of the following:

* Switch to signalfd for the event notification?
* Take si_pid and instead of just notifying that work is there.. inform about 
the PID that exited?
* Use wait(-1,... if there can be only one SIGCHLD handler to collect any dead 
child

--
components: asyncio
messages: 311692
nosy: asvetlov, holger+lp, yselivanov
priority: normal
severity: normal
status: open
title: asyncio SIGCHLD scalability problems

___
Python tracker 

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



[issue32749] Remove dbm.dumb behavior deprecated in 3.6

2018-02-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 6c85efa5a66d7b254aa22a39d47f36c040d7a04e by Serhiy Storchaka in 
branch 'master':
bpo-32749: Make dbm.dumb databases more cosistent with other dbm databases. 
(#5497)
https://github.com/python/cpython/commit/6c85efa5a66d7b254aa22a39d47f36c040d7a04e


--

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-05 Thread Jay Yin

Jay Yin  added the comment:

Will an option be added to copy_file() function? if we did we could probably 
make it preserve the times by default and have an -- option to make it update?

--
nosy: +jayyin11043

___
Python tracker 

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



[issue32749] Remove dbm.dumb behavior deprecated in 3.6

2018-02-05 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue32775] fnmatch.translate() can produce a pattern which emits a nested set warning

2018-02-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It is easy to fix sets starting with '['. It is more hard to fix sets with 
doubled '-', '&', '|' or '~'.

>>> fnmatch.fnmatch('#', '[#--]')
/home/serhiy/py/cpython/Lib/fnmatch.py:46: FutureWarning: Possible set 
difference at position 6
  return re.compile(res).match
True

--
assignee:  -> serhiy.storchaka
priority: normal -> high

___
Python tracker 

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



[issue30349] Preparation for advanced set syntax in regular expressions

2018-02-05 Thread Tim Graham

Tim Graham  added the comment:

Okay, I created #32775.

--

___
Python tracker 

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



[issue32775] fnmatch.translate() can produce a pattern which emits a nested set warning

2018-02-05 Thread Tim Graham

New submission from Tim Graham :

As discussed in issue30349#msg311684, fnmatch.translate() can produce a pattern 
which emits a nested set warning:

>>> import fnmatch, re
>>> re.compile(fnmatch.translate('[[]foo]'))
__main__:1: FutureWarning: Possible nested set at position 10
re.compile('(?s:\\(.s:[[]foo\\]\\)Z)\\Z')

--
components: Library (Lib)
messages: 311687
nosy: Tim.Graham, serhiy.storchaka
priority: normal
severity: normal
status: open
title: fnmatch.translate() can produce a pattern which emits a nested set 
warning
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue32752] no information about accessing typing.Generic type arguments

2018-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

with the help command, you have a good documentation, help(list_of_ints), but 
you are right, there is no functions/methods for your need.

in the code of typing, there is a comment about __args__ but it is not used by 
the documentation.

--
nosy: +matrixise

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-02-05 Thread Bernhard M. Wiedemann

Bernhard M. Wiedemann  added the comment:

Serhiy, can you test https://github.com/python/cpython/pull/5557

--

___
Python tracker 

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



[issue30693] tarfile add uses random order

2018-02-05 Thread Bernhard M. Wiedemann

Change by Bernhard M. Wiedemann :


--
keywords: +patch
pull_requests: +5379
stage: needs patch -> patch review

___
Python tracker 

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



[issue30349] Preparation for advanced set syntax in regular expressions

2018-02-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Good catch! fnmatch.translate() can produce a pattern which emits a warning 
when compiled. Could you please open a separate issue for this?

--

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I don't remember all details, here is what I have found.

Issue28230 and issue28231 -- the support of path-like object was added only for 
external names (paths of archives, paths of added files, paths for extraction), 
but not for internal names.

Issue29447 -- the initial idea was rejected, and it seems to me that the 
tempfile module doesn't need any changes. Path-like objects already are 
accepted for the dir argument, but they shouldn't be accepted for arguments 
like pre or suf which are not paths.

Issue29448 is only tangentially related. It's rejection is based on issue29447.

--

___
Python tracker 

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



[issue30349] Preparation for advanced set syntax in regular expressions

2018-02-05 Thread Tim Graham

Tim Graham  added the comment:

It might be worth adding part of the problematic regex to the warning message. 
For Django's tests, I see an error like "FutureWarning: Possible nested set at 
position 17 return re.compile(res).match". It took some effort to track down 
the source.

A partial traceback is:
  File "/home/tim/code/django/django/core/management/commands/loaddata.py", 
line 247, in find_fixtures
for candidate in glob.iglob(glob.escape(path) + '*'):
  File "/home/tim/code/cpython/Lib/glob.py", line 72, in _iglob
for name in glob_in_dir(dirname, basename, dironly):
  File "/home/tim/code/cpython/Lib/glob.py", line 83, in _glob1
return fnmatch.filter(names, pattern)
  File "/home/tim/code/cpython/Lib/fnmatch.py", line 52, in filter
match = _compile_pattern(pat)
  File "/home/tim/code/cpython/Lib/fnmatch.py", line 46, in _compile_pattern
return re.compile(res).match
  File "/home/tim/code/cpython/Lib/re.py", line 240, in compile
return _compile(pattern, flags)
  File "/home/tim/code/cpython/Lib/re.py", line 292, in _compile
p = sre_compile.compile(pattern, flags)
  File "/home/tim/code/cpython/Lib/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
  File "/home/tim/code/cpython/Lib/sre_parse.py", line 930, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/home/tim/code/cpython/Lib/sre_parse.py", line 426, in _parse_sub
not nested and not items))
  File "/home/tim/code/cpython/Lib/sre_parse.py", line 816, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
  File "/home/tim/code/cpython/Lib/sre_parse.py", line 426, in _parse_sub
not nested and not items))
  File "/home/tim/code/cpython/Lib/sre_parse.py", line 524, in _parse
FutureWarning, stacklevel=nested + 6
FutureWarning: Possible nested set at position 17

As an aside, I'm not sure how to fix the warning in Django. It comes from the 
test added in 
https://github.com/django/django/commit/98df288ddaba9787e4a370f12aba51c2b9133142
 where a path like 'tests/fixtures/fixtures/fixture_with[special]chars' is run 
through glob.escape() which creates 
'tests/fixtures/fixtures/fixture_with[[]special]chars'.

--
nosy: +Tim.Graham

___
Python tracker 

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



[issue32774] distutils: cyclic reference in the documentation

2018-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

ok, it's fine for me, I close this issue

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



[issue31215] Add version changed notes for OpenSSL 1.1.0 compatibility

2018-02-05 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
versions: +Python 3.8

___
Python tracker 

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



[issue32774] distutils: cyclic reference in the documentation

2018-02-05 Thread R. David Murray

R. David Murray  added the comment:

This is a common pattern in our documentation.  It is done because ":mod:`xxx`" 
means that xxx should be formatted as a module name, rather than anything else. 
 While it is true that the formatting for most such references is currently the 
same, it could be different in principle, and is for a few.  It is in some ways 
unfortunate that it also always results in a link, so you will indeed find a 
number of places where the prefix is omitted, mostly commonly when the same 
entity is referenced several times in the same paragraph.

So, it is not completely clear cut, but I would recommend rejecting this and 
leaving the docs as is.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-05 Thread Guido van Rossum

Guido van Rossum  added the comment:

Yeah, I think the use case for assigning to __bases__ has not been shown. I 
believe we've seen other situations where the initial list of base classes is 
used in some computation that affects how the class works, so I doubt it has 
ever been sound.

Though maybe the OP ("VA") has a real use case where they discovered this? Then 
it would be nice to know about it.

--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

maybe I miss something

but I have downloaded the last fedora:rawhide with docker, just update it via 
dnf update and install all the dependencies for git and python

docker --rm -it fedora:rawhide /bin/bash

dnf update
dnf install git-core
dnf builddep python3

git clone --depth=1 https://github.com/python/cpython
cd cpython
./configure && make

and I have no issue with ctypes.

What are your instructions for the build?

Thank you

--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-05 Thread Christian Heimes

Christian Heimes  added the comment:

Stéphane, the issue is only reproducible with latest Fedora rawhide.

--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I use Fedora 27,

Please, could you give the instructions for your build, I could test locally 
and check if the patch fixes the issue.

Thank you

--
nosy: +matrixise

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-05 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

got any pointers to those?  I want to familiarize myself with existing 
arguments for/against such a feature in subprocess to decide.

--

___
Python tracker 

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



[issue27643] test_ctypes fails on AIX with xlc

2018-02-05 Thread Michael Felt

Change by Michael Felt :


--
pull_requests: +5378

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-05 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +matrixise

___
Python tracker 

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



[issue32774] distutils: cyclic reference in the documentation

2018-02-05 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

in the documentation of the distutils module, there is a cyclic references, 
just remove them because I think it's useless.

--

___
Python tracker 

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



[issue32774] distutils: cyclic reference in the documentation

2018-02-05 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +patch
pull_requests: +5377
stage:  -> patch review

___
Python tracker 

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



[issue32774] distutils: cyclic reference in the documentation

2018-02-05 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
assignee: docs@python
components: Documentation
nosy: docs@python, matrixise
priority: normal
severity: normal
status: open
title: distutils: cyclic reference in the documentation
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-05 Thread R. David Murray

Change by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-05 Thread Jeroen Demeyer

New submission from Jeroen Demeyer :

When a Python project is installed, distutils copies the files from the build 
to install directory using copy_file(). In this copy operation, timestamps are 
preserved. In other words, the timestamp of the installed file equals the 
timestamp of the source file.

By contrast, autotools does not preserve timestamps: the timestamp of the 
installed files equals the time of installation. This makes more sense because 
of dependency checking: if you reinstall a package, you typically want to 
rebuild everything depending on that package.

This issue is mostly relevant for installing .h files: most build systems 
(including distutils itself) provide a way to recompile C/C++ source files if 
they depend on a changed header file. But that only works if the timestamp of 
the header is updated when it is installed.

Note that ./command/build_py.py contains a comment

# XXX copy_file by default preserves atime and mtime.  IMHO this is
# the right thing to do, but perhaps it should be an option -- in
# particular, a site administrator might want installed files to
# reflect the time of installation rather than the last
# modification time before the installed release.

but without justification.

--
components: Distutils
messages: 311673
nosy: dstufft, eric.araujo, erik.bray, jdemeyer
priority: normal
severity: normal
status: open
title: distutils should NOT preserve timestamps
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32760] [Python Shell command issue]

2018-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

It's normal, when you execute a command, there is a fork/exec, fork for the new 
process, and the exec will replace the memory of the previous process by the 
new process.

in os.system, you use ('export MYENVPATH=/usr/bin/gcc') but this variable only 
exists for the $SHELL process, once this one is finished, the variable is just 
destroyed.

You have to pass all the env variables when you call your process, read the doc 
of subprocess.Popen, there is a env variable, you have to pass the value to 
this parameter

https://docs.python.org/2.7/library/subprocess.html?highlight=subprocess#subprocess.Popen

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



[issue30339] test_multiprocessing_main_handling: "RuntimeError: Timed out waiting for results" on x86 Windows7 3.x

2018-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

TLDR; but there is a new status for the associated PR 
https://github.com/python/cpython/pull/1978

--
nosy: +matrixise

___
Python tracker 

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



[issue32613] Use PEP 397 py launcher in windows faq

2018-02-05 Thread Julien Palard

Julien Palard  added the comment:

The py command come from PEP 397, its rational will be more verbose than me 
[1], but in a nutshell it's a wrapper trying to find the right python according 
to some heuristics like the shebang.

[1]: https://www.python.org/dev/peps/pep-0397/#rationale

--

___
Python tracker 

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



[issue32613] Use PEP 397 py launcher in windows faq

2018-02-05 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Just for my info, what's the origin of 'py' ? and why does 'py' exists?

--
nosy: +matrixise

___
Python tracker 

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



[issue25988] collections.abc.Indexable

2018-02-05 Thread Tim Graham

Tim Graham  added the comment:

The last commit that added the deprecation warning needs to be added to the 3.7 
branch.

--
nosy: +Tim.Graham

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-05 Thread Nick Coghlan

Nick Coghlan  added the comment:

I've added Guido to the thread, as my initial reaction is to propose 
deprecating writable __bases__ rather than trying to support it properly.

However, if we do decide to fix it, then the potential path to resolution I 
would suggest is:

1. Factor out all of the slot derivation code from its current location into a 
separate helper function
2. Adjust the descriptor for __bases__ to rerun all of that code when the bases 
are changed

That still wouldn't be guaranteed to work entirely reliably (since there are 
some actions taken in the first initialisation that make it hard for us to tell 
whether a method came from the class definition or was added implicitly by the 
class machinery, and any class decorators wouldn't be executed again, and we 
wouldn't be running __init_subclass__ for any of the new base classes either).

--
nosy: +gvanrossum

___
Python tracker 

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



[issue32613] Use PEP 397 py launcher in windows faq

2018-02-05 Thread Julien Palard

Change by Julien Palard :


--
keywords: +patch
pull_requests: +5376
stage: needs patch -> patch review

___
Python tracker 

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



[issue32770] collections.counter examples are misleading

2018-02-05 Thread Anthony Flury

Anthony Flury  added the comment:

Raymond, 
I completely understand your comment but I do disagree.

My view would be that the documentation of the stdlib should document the entry 
level use cases.
The first example given uses nothing special from the Counter class - you could 
implement exactly the same with a defaultdict(int) - the only difference would 
be that output will read defaultdict(,{'blue': 3, 'red': 2, 
'green': 1}).

I think the examples in the documentation should at least demonstrate something 
important on the class being documented - and the first example doesn't.

I am very tempted to re-open - but I wont - no benefit in bouncing the status 
as we discuss this.

--

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-05 Thread Christian Heimes

Christian Heimes  added the comment:

configure.ac already contains the check:

   AC_CHECK_LIB(dl, dlopen)

It should be enough to add:

if sysconfig.get_config_var('HAVE_LIBDL'):
libs.append('dl')

to ctypes.

--
type:  -> compile error
versions: +Python 3.8

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-05 Thread Christian Heimes

Change by Christian Heimes :


--
keywords: +patch
pull_requests: +5375
stage:  -> patch review

___
Python tracker 

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



[issue32647] Undefined references when compiling ctypes on binutils 2.29.1 with gcc -Wl, -z, undefs (Fedora 28)

2018-02-05 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

So what would be the best way to proceed from here?

Add a check or just link to dl unconditionally?

--

___
Python tracker 

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




[issue27643] test_ctypes fails on AIX with xlc

2018-02-05 Thread Michael Felt

Change by Michael Felt :


--
versions: +Python 3.7

___
Python tracker 

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



[issue32772] lstrip not working when string has =e in it

2018-02-05 Thread Christian Heimes

Christian Heimes  added the comment:

Please read the documentation again. lstrip doesn't work like you assume:

>>> "cbaabcdef".lstrip("abc")
'def'

--
nosy: +christian.heimes

___
Python tracker 

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



[issue32772] lstrip not working when string has =e in it

2018-02-05 Thread Narendra L

Narendra L  added the comment:

If you see output dttrace e is missing 

see working example
>>> test = "Cookie:  test-Debug=edttrace=expires=1517828996"
>>> test.lstrip('Cookie:  test-Debug=')
'dttrace=expires=1517828996'
# e missing here


>>> test = "Cookie:  test-Debug=adttrace=expires=1517828996"
>>> test.lstrip('Cookie:  test-Debug=')
'adttrace=expires=1517828996'
# Works correct here

--

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-05 Thread INADA Naoki

INADA Naoki  added the comment:

This is assembly code for FAST_DISPATCH()
https://paste.ubuntu.com/26523948/

It seems there are many redundant spills.  But I don't know how to remove them.
Are their clang expert?

--

___
Python tracker 

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



[issue32772] lstrip not working when string has =e in it

2018-02-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It works as documented. Removes characters specified by the argument from the 
string. In your example the argument contains "e", but doesn't contain "d". 
Therefore starting characters up to "d" have been removed.

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



[issue32772] lstrip not working when string has =e in it

2018-02-05 Thread Narendra L

New submission from Narendra L :

Lstrip not working as expected when the string has "=e" in it.

Python 2.7.11 (default, Jan 22 2016, 08:28:37)

>>> test = "Cookie:  test-Debug=edttrace=expires=1517828996"
>>> test.lstrip('Cookie:  test-Debug=')
'dttrace=expires=1517828996'

--
components: Library (Lib)
messages: 311659
nosy: Narendra L
priority: normal
severity: normal
status: open
title: lstrip not working when string has =e in it
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue30698] asyncio sslproto do not shutdown ssl layer cleanly

2018-02-05 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue9216] FIPS support for hashlib

2018-02-05 Thread Charalampos Stratakis

Change by Charalampos Stratakis :


--
pull_requests: +5374

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-05 Thread Ma Lin

Ma Lin  added the comment:

> Or the issue is specific for TCP_KEEPCNT for Windows only?

Four flags involved.
In this table, result column is search results from GitHub.

  keyword   available   result
TCP_FASTOPEN   win10 1607+   778
TCP_KEEPCNTwin10 1703+   3356
TCP_KEEPIDLE   win10 1709+   4820
TCP_KEEPINTVL  win10 1709+   3410

3.6 branch is using 1703 SDK, 3.7/3.8 branches are using 1709 SDK.

This discussion is beyond my knowledge, I keep watch.

--

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5373

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-05 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5372

___
Python tracker 

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



[issue32720] Format mini-language integer definition is incorrect

2018-02-05 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 7a561afd2c79f63a6008843b83733911d07f0119 by Mariatta in branch 
'master':
bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)
https://github.com/python/cpython/commit/7a561afd2c79f63a6008843b83733911d07f0119


--

___
Python tracker 

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



[issue32768] object.__new__ does not accept arguments if __bases__ is changed

2018-02-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The problem is that

class C(B):
pass
C.__bases__ = (A,)

and

class C(A):
pass

are not fully equivalent.

In the first case type->tp_new != object_new.

--
components: +Interpreter Core
nosy: +ncoghlan, serhiy.storchaka
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue32771] merge the underlying data stores of unicodedata and the str type

2018-02-05 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

+1. And perhaps a new C API for direct access to the Unicode DB should be 
provided.

--
components: +Interpreter Core
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-05 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

I definitely don't think we should get into the game of trying to guess which 
flags are supported at runtime and only exposing those. It's not as simple as 
keeping a table of OS versions -- which would be hard enough to get right -- 
but on Linux you can have things like vendor backports of features to old 
versions, or a new kernel that happens to have had a particular feature 
configured out of it. (For example, AFAIK some major cloud providers still use 
kernels that have had IPv6 support removed entirely.)

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-05 Thread INADA Naoki

INADA Naoki  added the comment:

> What's about other OS/flags?
> Should we commit that every exposed socket flag is supported in runtime?
It looks like very heavy burden.

I agree with you.  It almost impossible.

> Or the issue is specific for TCP_KEEPCNT for Windows only?

As far as my understanding, Yes.  This issue is only for it.

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-05 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

What's about other OS/flags?
Should we commit that every exposed socket flag is supported in runtime?
It looks like very heavy burden.

Or the issue is specific for TCP_KEEPCNT for Windows only?

--

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-02-05 Thread INADA Naoki

INADA Naoki  added the comment:

It seems clang4 failed to efficient register assigning.
FYI, --without-computed-gotos configure option make penalty smaller.

clang 5 (wihtout CGs): 2.653426
clang 5 (with CGs): 1.997584
clang 4 (without CGs): 3.330879
clang 4 (with CGs): 8.585673

--

___
Python tracker 

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



[issue32760] [Python Shell command issue]

2018-02-05 Thread JamesDinh

JamesDinh  added the comment:

Hi,

>From this stackoverflow thread:
https://stackoverflow.com/questions/716011/why-cant-environmental-variables-set-in-python-persist

I find out there is an abnormal environment variable setting affects by using 
shell command.
Do you have some explanation for the shell command runs?
For your information, if I run below commands:
os.system("export MYENVPATH=/opt/toolchain/gcc")
os.system("./configure O=output project_name debug initramfs nofirewall && make 
O=output")
Then the configure command can't detect the MYENVPATH value.

--

___
Python tracker 

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



[issue30928] Copy modified blurbs to idlelib/NEWS.txt

2018-02-05 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset 7bd5a75bbe28219d3fc18a239c2c554d1850abcb by Terry Jan Reedy in 
branch '3.6':
bpo-30928: IDLE - update NEWS.txt [GH-5539] (GH-5545)
https://github.com/python/cpython/commit/7bd5a75bbe28219d3fc18a239c2c554d1850abcb


--

___
Python tracker 

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



[issue32761] Create IDLE Modern Mac keyset

2018-02-05 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Mac key bindings and Shell home method behavior are separate and long-standing 
issues.  They were discussed together in #18444, and this could be considered a 
duplicate thereof.  However, the two issues need to be discussed and solved 
separately.
  
1. The bindings of  and <> on Macs.  The more 
general issue is IDLE key bindings on MacOSX.

Here are the beginning-of-line and select-all bindings in the various keysets. 

>From idlelib/config-keys.def
[IDLE Classic Windows]
beginning-of-line= 
select-all= 

[IDLE Classic Unix]
beginning-of-line= 
select-all= 

[IDLE Modern Unix] # default on *nix, design by Serhiy Storchaka
beginning-of-line = 
select-all = 

[IDLE Classic Mac] # so obsolete that it almost should be removed?
beginning-of-line= 
select-all=

[IDLE Classic OSX]
beginning-of-line = 
select-all = 

I am guessing that Raymond is using a Mac and a customized version of IDLE 
Classic OSX with Control-Key-A added as either *a* or *the* binding of the 
<, in Shell.  Jumping to the physical start of line was 
fixed, at least on *nix and Windows, in #3851.  I remember verifying this.  Yet 
now, on Win 10, the old behavior is back.  So, this is not only a Mac issue and 
this part is a duplicate of #31930.

The underlying issue is the mixing of a read-only prompt and the first line of 
a possibly multiline read-write Python statement in the Shell text widget.  
This also leads to the indent problem and a couple of other minor issues.  In 
retrospect, I consider this mixing a design mistake and I am working on a 
suggestion about fixing it.

--
nosy: +ned.deily
title: IDLE Keymap for Cntl-A -> Create IDLE Modern Mac keyset

___
Python tracker 

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



[issue31930] IDLE: Pressing "Home" on Windows places cursor before ">>>"

2018-02-05 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

On #32761, Raymond reports that is ^A ('Home' for him) is bound to 
<>, he sees the same behavior.  So this is not Windows only.

Any change to EditorWindow.home_callback must be tested on all 3 major systems 
before merging.

I hope to fix this and other Shell issues by separating prompt and code entry, 
in a proposal-in-progress, but home_callback would still need editing.

--

___
Python tracker 

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