[issue35545] asyncio.base_events.create_connection doesn't handle scoped IPv6 addresses

2019-01-04 Thread twisteroid ambassador


twisteroid ambassador  added the comment:

I just noticed that in the socket module, an AF_INET address tuple is allowed 
to have an unresolved host name. Quote:

A pair (host, port) is used for the AF_INET address family, where host is a 
string representing either a hostname in Internet domain notation like 
'daring.cwi.nl' or an IPv4 address like '100.50.200.5', and port is an integer.

https://docs.python.org/3/library/socket.html#socket-families

Passing a tuple of (hostname, port) to socket.connect() successfully connects 
the socket (tested on Windows). Since the C struct sockaddr_in does not support 
hostnames, socket.connect obviously does resolution at some point, but its 
implementation is in C, and I haven't looked into it.

BaseSelectorEventLoop.sock_connect() calls socket.connect() directly, therefore 
it also supports passing in a tuple of (hostname, port). I just tested 
ProactorEventLoop.sock_connect() on 3.7.1 on Windows, and it does not support 
hostnames, raising OSError: [WinError 10022] An invalid argument was supplied.

I personally believe it's not a good idea to allow hostnames in address tuples 
and in sock.connect(). However, the socket module tries pretty hard to 
basically accept any (host, port) tuple as address tuples, whether host is an 
IPv4 address, IPv6 address or host name, so that's probably not going to change.

--

___
Python tracker 

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



[issue35545] asyncio.base_events.create_connection doesn't handle scoped IPv6 addresses

2019-01-04 Thread twisteroid ambassador


twisteroid ambassador  added the comment:

Oh wait, there's also this in asyncio docs for loop.sock_connect:

Changed in version 3.5.2: address no longer needs to be resolved. sock_connect 
will try to check if the address is already resolved by calling 
socket.inet_pton(). If not, loop.getaddrinfo() will be used to resolve the 
address.

https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.sock_connect

So this is where the current bug comes from! My PR 11403 basically undid this 
change.

My proposal, as is probably obvious, is to undo this change and insist on 
passing only resolved address tuples to loop.sock_connect(). My argument is 
that this feature never worked properly: 

* As mentioned in the previous message, this does not work on ProactorEventLoop.
* On SelectorEventLoop, the resolution done by loop.sock_connect() is pretty 
weak anyways: it only takes the first resolved address, unlike 
loop.create_connection() that actually tries all the resolved addresses until 
one of them successfully connects.

Users should use create_connection() or open_connection() if they want to avoid 
the complexities of address resolution. If they are reaching for low_level APIs 
like loop.sock_connect(), they should also handle loop.getaddrinfo() themselves.

--

___
Python tracker 

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



[issue35654] Remove 'guarantee' that sorting only relies on __lt__ from sorting howto

2019-01-04 Thread Martijn Pieters


Martijn Pieters  added the comment:

Well, if this is indeed by design (and I missed the list.sort() reference) then 
I agree the HOWTO should not be changed!

I'd be happy to change this to asking for more explicit mentions in the docs 
for sorted, heapq and bisect that using only < (__lt__) is a deliberate choice.

--

___
Python tracker 

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



[issue35654] Remove 'guarantee' that sorting only relies on __lt__ from sorting howto

2019-01-04 Thread Martijn Pieters


Martijn Pieters  added the comment:

(I have no opinion on this having to be a language feature however)

--

___
Python tracker 

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



[issue35655] documentation have wrong info about fibo module examples

2019-01-04 Thread Juan


New submission from Juan :

The below sections in modules documentation have wrong information about fibo 
module:
6. Modules
6.1. More on Modules
6.1.1. Executing modules as scripts
6.3. The dir() Function

The name of module is Fibo not fibo and the attributes are fab,fab2 not 
fib,fib2.


root@archlinux ~]# python2 --version
Python 2.7.15
[root@archlinux ~]# pip2 --version
pip 18.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)
[root@archlinux ~]# pip2 install fibo
Collecting fibo
  Using cached 
https://files.pythonhosted.org/packages/24/50/e74bd48bbef1040afb01b107e6cfbc3c1e991be24c10c40a37e335383e54/Fibo-1.0.0.tar.gz
Installing collected packages: fibo
  Running setup.py install for fibo ... done
Successfully installed fibo-1.0.0
[root@archlinux ~]# pip2 list modules |grep -i fibo
Fibo 1.0.0  
[root@archlinux ~]# python2
Python 2.7.15 (default, Jun 27 2018, 13:05:28) 
[GCC 8.1.1 20180531] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fibo
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named fibo
>>> import Fibo
>>> Fibo.fib(10)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute 'fib'
>>> Fibo.fib2(10)
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute 'fib2'
>>> Fibo.fab(10)
1
1
2
3
5
8
13
21
34
55
>>> Fibo.fab2(10)
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
>>> Fibo.__name__
'Fibo'
>>> dir(Fibo)
['Fab', '__builtins__', '__doc__', '__file__', '__name__', '__package__', 
'fab', 'fab2', 'fab4']

--
assignee: docs@python
components: Documentation
messages: 332967
nosy: docs@python, eric.araujo, ezio.melotti, juanbaio10, mdk, willingc
priority: normal
severity: normal
status: open
title: documentation have wrong info about fibo module examples
type: enhancement
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



[issue35656] More matchers in unittest.mock

2019-01-04 Thread Petter S


New submission from Petter S :

The ``ANY`` object in ``unittest.mock`` is also pretty useful when verifying 
dicts in tests:

self.assertEqual(result, {
"message": "Hi!",
"code": 0,
"id": mock.ANY
})

Then it does not matter what the (presumably randomly generated) id is. For the 
same use cases, objects like ``APPROXIMATE`` (for approximate floating-point 
matching) and ``MATCHES`` (taking a boolean lambda) would be pretty useful, I 
think.

--
components: Library (Lib)
messages: 332968
nosy: Petter S
priority: normal
severity: normal
status: open
title: More matchers in unittest.mock
type: enhancement

___
Python tracker 

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



[issue35655] documentation have wrong info about fibo module examples

2019-01-04 Thread Christian Heimes


Christian Heimes  added the comment:

The documentation examples are not based on the 3rd party Fibo Python package. 
All examples are based on the short script 
https://docs.python.org/3/tutorial/modules.html?highlight=fibo#modules :

  For instance, use your favorite text editor to create a file
  called fibo.py in the current directory with the following contents

--
nosy: +christian.heimes
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



[issue35657] multiprocessing.Process.join() ignores timeout if child process use os.exec*()

2019-01-04 Thread Huazuo Gao


New submission from Huazuo Gao :

import os
import time
from multiprocessing import Process

p = Process(target=lambda:os.execlp('bash', 'bash', '-c', 'sleep 1.5'))
t0 = time.time()
p.start()
p.join(0.1)
print(time.time() - t0)

---

Python 3.5 - 3.8 take 1.5 sec to finish
Python 2.7 take 0.1 sec to finish

--
components: Library (Lib)
messages: 332970
nosy: Huazuo Gao
priority: normal
severity: normal
status: open
title: multiprocessing.Process.join() ignores timeout if child process use 
os.exec*()
type: behavior
versions: 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



[issue35198] Build issue while compiling cpp files in AIX

2019-01-04 Thread Michael Felt


Michael Felt  added the comment:

While the PR probably solves this - there is a 'bug' in pandas (I expect) that 
prevents me from completing the test - as, I expect LONG before the .cpp source 
is to be compiled - there is a error because a wrong flag is passed to the 
compiler (-Wno-unused-function) and the build stops.

Have not had the time to disect pandas so that I can get a .cpp source compiled.

+
Successfully installed pip-18.1
root@x066:[/data/prj/python/git/kadler]pip list
/opt/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/_base.py:3: 
DeprecationWdeprecated, and in 3.8 it will stop working
  from collections import Mapping
PackageVersion
-- ---
pip18.1
setuptools 39.0.1
root@x066:[/data/prj/python/git/kadler]pip install numpy
/opt/lib/python3.8/site-packages/pip/_vendor/html5lib/_trie/_base.py:3: 
DeprecationWdeprecated, and in 3.8 it will stop working
  from collections import Mapping
Collecting numpy
/opt/lib/python3.8/site-packages/pip/_vendor/msgpack/fallback.py:220: 
PendingDepreca
  warnings.warn(
  Using cached 
https://files.pythonhosted.org/packages/2d/80/1809de155bad674b494248b
Installing collected packages: numpy
  Running setup.py install for numpy ... done
Successfully installed numpy-1.15.4

...
Installing collected packages: six, python-dateutil, pytz, pandas
...
copying pandas/io/formats/templates/html.tpl -> 
build/lib.aix-6.1-3.8-pydebug/pandas/io/formats/templates
UPDATING build/lib.aix-6.1-3.8-pydebug/pandas/_version.py
set build/lib.aix-6.1-3.8-pydebug/pandas/_version.py to '0.23.4'
running build_ext
building 'pandas._libs.algos' extension
creating build/temp.aix-6.1-3.8-pydebug
creating build/temp.aix-6.1-3.8-pydebug/pandas
creating build/temp.aix-6.1-3.8-pydebug/pandas/_libs
xlc_r -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -I/opt/include -O2 
-qmaxmem=-1 -qarch=pwr5 -Ipandas/_libs/src/klib -Ipandas/_libs/src 
-I/opt/lib/python3.8/site-packages/numpy/core/include 
-I/opt/include/python3.8dm -c pandas/_libs/algos.c -o 
build/temp.aix-6.1-3.8-pydebug/pandas/_libs/algos.o -Wno-unused-function
xlc_r: 1501-210 (S) command option Wno-unused-function contains an 
incorrect subargument
error: command 'xlc_r' failed with exit status 40


Command "/opt/bin/python3 -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-install-xnscgehv/pandas/setup.py';f=getattr(tokenize,
 'open', open)(__file__);code=f.read().replace('\r\n', 
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
/tmp/pip-record-0w46p413/install-record.txt --single-version-externally-managed 
--compile" failed with error code 1 in /tmp/pip-install-xnscgehv/pandas/

--

___
Python tracker 

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



[issue10948] Trouble with dir_util created dir cache

2019-01-04 Thread Malcolm Smith


Malcolm Smith  added the comment:

Please reopen this issue. The distutils2 project has now been abandoned, so 
that's no longer a justification for taking no action. 

At the very least, the documentation should be fixed to either warn about this 
surprising behavior, or make it clear that the the dir_util functions are for 
distutils internal use only.

--
nosy: +Malcolm Smith
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



[issue35658] Reggie_Linear_Regression_Solution.ipynb devide by 10 diff with multiply by .1

2019-01-04 Thread Bart van den Donk


New submission from Bart van den Donk :

possible_ms1 = [i*.1 for i in range(-100, 101, 1)] #your list comprehension here
print(possible_ms1)
possible_ms2 = [i/10 for i in range(-100, 101, 1)] #your list comprehension here
print(possible_ms2)

Multiply by .1 gives dirty results.
Divide by 10 gives clean results.

--
components: Demos and Tools, Regular Expressions
messages: 332973
nosy: Bart van den Donk, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Reggie_Linear_Regression_Solution.ipynb devide by 10 diff with multiply 
by .1
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



[issue35609] Improve of abc.py docstring

2019-01-04 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

> No plan for removal.  See https://bugs.python.org/issue28886#msg282582

Thanks!

--

___
Python tracker 

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



[issue35658] Reggie_Linear_Regression_Solution.ipynb devide by 10 diff with multiply by .1

2019-01-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Not a bug. 0.1 is a binary floating point value, please read the FAQs:

https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate

1/10 = 0.1 in decimal cannot be represented *exactly* in binary floating point, 
so when you type 0.1 as a float, the actual value you get is the closest number 
you can get using 53 bits for the significant digits, 8 bits for the exponent 
and 1 bit for the sign (plus or minus). That is approximately 
0.156 or so.

Unfortunately you cannot get any closer to 1/10 in binary floating point 
numbers, for the same reason you cannot get 1/3 exactly in decimal.

See also 

https://stackoverflow.com/questions/8215437/floating-point-accuracy-in-python

https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate

https://stackoverflow.com/questions/1089018/why-cant-decimal-numbers-be-represented-exactly-in-binary?noredirect=1&lq=1

--
nosy: +steven.daprano
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



[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict

2019-01-04 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

ping Vaibhav :-)

> I would like to make a PR for this.

--
nosy: +eamanu

___
Python tracker 

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



[issue24928] mock.patch.dict spoils order of items in collections.OrderedDict

2019-01-04 Thread Vaibhav Gupta


Vaibhav Gupta  added the comment:

Hi Emmanuel

Please go ahead and make a PR. :)

--

___
Python tracker 

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



[issue23867] Argument Clinic: inline parsing code for 1-argument functions

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

Nice optimization! I wanted to implement it, but then I forgot.

--

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10853

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10853, 10854

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset 31ec52a9afedd77e36a3ddc31c4c45664b8ac410 by Ivan Levkivskyi 
(Ville Skyttä) in branch 'master':
bpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)
https://github.com/python/cpython/commit/31ec52a9afedd77e36a3ddc31c4c45664b8ac410


--

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10854, 10856

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10856, 10857

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10856, 10857, 10858

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10853, 10854, 10855, 10856, 10857, 10858

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread miss-islington


miss-islington  added the comment:


New changeset 902196d867a34cc154fa9c861c883e69232251c6 by Miss Islington (bot) 
in branch '3.7':
bpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)
https://github.com/python/cpython/commit/902196d867a34cc154fa9c861c883e69232251c6


--
nosy: +miss-islington

___
Python tracker 

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



[issue35631] Improve typing docs wrt abstract/concrete collection types

2019-01-04 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

I think this can be closed now. Whether to merge doc-fix backport to now 
security-only 3.6 branch is up to Ned.

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



[issue35657] multiprocessing.Process.join() ignores timeout if child process use os.exec*()

2019-01-04 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

I don't know what triggered the change, but I strongly suspect this is not a 
supported use of the multiprocessing module; Process is for worker processes 
(still running Python), and it has a lot of coordination machinery set up 
between parent and child (for use by, among other things,  join) that exec 
severs rather abruptly.

Launching unrelated child processes is what the subprocess module is for.

--
nosy: +josh.r

___
Python tracker 

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



[issue35657] multiprocessing.Process.join() ignores timeout if child process use os.exec*()

2019-01-04 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Looks like the cause of the change was when os.pipe was changed to create 
non-inheritable pipes by default; if I monkey-patch 
multiprocessing.popen_fork.Popen._launch to use os.pipe2(0) instead of 
os.pipe() to get inheritable descriptors or just clear FD_CLOEXEC in the child 
with fcntl.fcntl(child_w, fcntl.F_SETFD, 0), the behavior returns to Python 2's 
behavior.

The problem is caused by the mismatch in lifetimes between the pipe fd and the 
child process itself; normally the pipe lives as long as the child process 
(it's never actually touched in the child process at all, so it just dies with 
the child), but when exec gets involved, the pipe is closed long before the 
child ends.

The code in Popen.wait that is commented with "This shouldn't block if wait() 
returned successfully" is probably the issue; wait() first waits on the parent 
side of the pipe fd, which returns immediately when the child execs and the 
pipe is closed. The code is assumes the poll on the process itself can be run 
in blocking (since the process should have ended already) but this assumption 
is wrong of course.

Possible solutions:

1. No code changes; document that exec in worker processes is unsupported (use 
subprocess, possibly with a preexec_fn, for this use case).

2. Precede the call to process_obj._bootstrap() in the child with 
fcntl.fcntl(child_w, fcntl.F_SETFD, 0) to clear the CLOEXEC flag on the child's 
descriptor, so the file descriptor remains open in the child post-exec. Using 
os.pipe2(0) instead of os.pipe() in _launch would also work and restore the 
precise 3.3 and earlier behavior, but it would introduce reintroduce race 
conditions with parent threads, so it's better to limit the scope to the child 
process alone, for the child's version of the fd alone.

3. Change multiprocessing.popen_fork.Popen.wait to use os.WNOHANG for all calls 
with a non-None timeout (not just timeout=0.0), rather than trusting 
multiprocessing.connection.wait's return value (which only says whether the 
pipe is closed, not whether the process is closed). Problem is, this would just 
change the behavior from waiting for the lifetime of the child no matter what 
to waiting until the exec and then returning immediately, even well before the 
timeout; it might also introduce race conditions if the fd registers as being 
closed before the process is fully exited. Point is, this approach would likely 
require a lot of subtle tweaks to make it work.

I'm in favor of either #1 or #2. #2 feels like a intentionally opening a 
resource leak on the surface, but I think it's actually fine, since we already 
signed up for a file descriptor that would live for the life of the process; 
the fact that it's exec-ed seems sort of irrelevant.

--
keywords: +3.4regression

___
Python tracker 

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



[issue35198] Build issue while compiling cpp files in AIX

2019-01-04 Thread Kevin


Kevin  added the comment:

Ah. We always compile with GCC, so would not have hit that particular problem.

--

___
Python tracker 

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



[issue9305] Don't use east/west of UTC in date/time documentation

2019-01-04 Thread Ajay Mahato


Ajay Mahato  added the comment:

I would like to work on this issue. Please assign this to me.

--
nosy: +Ajay Mahato

___
Python tracker 

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



[issue19120] shlex.shlex.lineno reports a different number depending on the previous token

2019-01-04 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

There was a parameter `punctuation_chars` added to the shlex.shlex class with 
issue 1521950 (implemented for 3.6).  Although the comma is not one of the 
default punctuation characters (setting the parameter to punctuation_chars=True 
won't change the behavior), you can use `punctuation_chars=","` to see the 
results reported in this issue.


>>> second = shlex.shlex('word1 word2,\nword3', punctuation_chars=',')
>>> second.get_token()
'word1'
>>> second.lineno
1
>>> second.get_token()
'word2'
>>> second.lineno
1
>>> second.get_token()
','
>>> second.lineno
2
>>>


Closing this as a duplicate of #1521950.

--
nosy: +cheryl.sabella
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> shlex.split() does not tokenize like the shell

___
Python tracker 

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



[issue35431] Add a function for computing binomial coefficients to the math module

2019-01-04 Thread Yash Aggarwal


Yash Aggarwal  added the comment:

@steven.daprano 
> Are you also providing a perm(n, k) function?
I didn't know it is also being implemented. Should I start on that too?

My implementation is based on these requirements:

> - Spell it comb(n, k).
> - TypeError if args aren't ints.
> - ValueError if not 0 <= k <= n.

Should the bincoeff function be same with exception of allowing negative n?

--

___
Python tracker 

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



[issue35431] Add a function for computing binomial coefficients to the math module

2019-01-04 Thread Tim Peters


Tim Peters  added the comment:

Please resist pointless feature creep.  The original report was about comb(n, 
k) for integer n and k with 0 <= k <= n and that's all.  Everyone who commented 
appeared to agree they'd find that useful.

But nobody has said they'd find generalizing beyond those constraints USEFUL, 
or that they'd find perm(n, k) USEFUL.  They just pointed out that such things 
are possible.

Every bit of new API implies eternal maintenance, porting, testing, doc, and 
conceptual costs.  So please stick to what's (at least nearly) universally 
agreed to be useful.  Complications can be added later if there turns out to be 
real demand for them.

--

___
Python tracker 

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



[issue35198] Build issue while compiling cpp files in AIX

2019-01-04 Thread Michael Felt


Michael Felt  added the comment:

On 04/01/2019 17:08, Kevin wrote:
> Kevin  added the comment:
>
> Ah. We always compile with GCC, so would not have hit that particular problem.
>
> --
>
> ___
> Python tracker 
> 
> ___
>
FYI. I found a 'hack' in ./setup.py to skip adding the argument.
Progressing.

--

___
Python tracker 

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



[issue35431] Add a function for computing binomial coefficients to the math module

2019-01-04 Thread Yash Aggarwal


Yash Aggarwal  added the comment:

@tim.peters
Got it.

--

___
Python tracker 

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



[issue35168] shlex punctuation_chars inconsistency

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
keywords: +easy
nosy: +docs@python
stage:  -> needs patch
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



[issue35198] Build issue while compiling cpp files in AIX

2019-01-04 Thread Michael Felt


Michael Felt  added the comment:

Further along - however, I never get to the "link" routine.

Again, this is likely a pandas coding issue - currently python is calling xlc_r 
..., but when I manually modify it to xlC_r I get the same error.

xlc_r -D_LARGE_FILES -O -I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 
-I/opt/include -O2 -qmaxmem=-1 -qarch=pwr5 -Ipandas/_libs -I./pandas/_libs 
-Ipandas/_libs/src/klib -Ipandas/_libs/src 
-I/opt/lib/python3.8/site-packages/numpy/core/include 
-I/opt/include/python3.8dm -c pandas/_libs/window.cpp -o 
build/temp.aix-6.1-3.8-pydebug/pandas/_libs/window.o
"pandas/_libs/window.cpp", line 9943.23: 1540-0063 (S) The text "(" is 
unexpected.
"pandas/_libs/window.cpp", line 10030.23: 1540-0063 (S) The text "(" is 
unexpected.
"pandas/_libs/window.cpp", line 11165.21: 1540-0063 (S) The text "(" is 
unexpected.
error: command 'xlc_r' failed with exit status 1
root@x066:[/data/prj/aixtools/git/pandas-master]ebug/pandas/_libs/window.o  
  <
"pandas/_libs/window.cpp", line 9943.23: 1540-0063 (S) The text "(" is 
unexpected.
"pandas/_libs/window.cpp", line 10030.23: 1540-0063 (S) The text "(" is 
unexpected.
"pandas/_libs/window.cpp", line 11165.21: 1540-0063 (S) The text "(" is 
unexpected.

root@x066:[/data/prj/aixtools/git/pandas-master]xlC_r -D_LARGE_FILES -O 
-I/opt/include -O2 -qm>
"pandas/_libs/window.cpp", line 9943.23: 1540-0063 (S) The text "(" is 
unexpected.
"pandas/_libs/window.cpp", line 10030.23: 1540-0063 (S) The text "(" is 
unexpected.
"pandas/_libs/window.cpp", line 11165.21: 1540-0063 (S) The text "(" is 
unexpected.

FYI. Will look more tomorrow, but if you have an idea, like the -D_LARGE_FILES 
fix, I am much obliged.

--

___
Python tracker 

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



[issue34522] PyTypeObject's tp_base initialization bug

2019-01-04 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue35617] unittest discover does not work with implicit namespaces

2019-01-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

If this is truly a duplicate, this should be closed and the issue number in the 
pr title changed to 23882.  Any reviewer should look at both proposed fixes, as 
they are not the same.  The other patch has what looks like the beginning of a 
test.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue35625] Comprehension doc doesn't mention buggy class scope behavior

2019-01-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: documentation of list, set & dict comprehension make no mention of buggy 
class scope behavior -> Comprehension doc doesn't mention buggy class scope 
behavior
versions: +Python 3.8 -Python 2.7, Python 3.4, 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



[issue35627] multiprocessing.queue in 3.7.2 doesn't behave as it was in 3.7.1

2019-01-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue35627] multiprocessing.queue in 3.7.2 doesn't behave as it was in 3.7.1

2019-01-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I couldn't reproduce on Ubuntu either.  I tried the "fork", "forkserver" and 
"spawn" methods (all with 3.7.2).

Terry, if you are on Windows, can you try the script?  Be sure to enclose the 
test() call in a "if __name__ == '__main__'" guard.

--

___
Python tracker 

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



[issue35624] Shelve sync issues while using Gevent

2019-01-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

3.6 only gets security fixes.  Please verify that there is a problem in 3.8 (or 
at least 3.7)

Also demonstrate that issue is not with the 3rd party gevent module.  Does 
gevent includes compiled non-python code?  (I suspect it does, but don't know.) 
 If so, your script should *not* import that extension.  Or you should close 
this as '3rd party' and submit a report to the gevent authors, who should be 
better able to determine where the problem originates.

--
nosy: +terry.reedy
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Indeed, looks like a duplicate.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> multiprocessing.Pool.imaps iterators do not maintain alive the 
multiprocessing.Pool objects

___
Python tracker 

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



[issue33896] Document what components make up the filecmp.cmp os.stat signature.

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
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



[issue12991] Python 64-bit build on HP Itanium - Executable built successfully but modules failed with HP Compiler

2019-01-04 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Closed based on msg323776.

--
nosy: +cheryl.sabella
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue35381] Heap-allocated posixmodule types

2019-01-04 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue15457] consistent treatment of generator terminology

2019-01-04 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Issue24400 changed some of the documentation wording around generators.  I 
don't know if there is still interest in applying the other parts of this patch.

--
nosy: +cheryl.sabella
versions: +Python 3.7, Python 3.8 -Python 2.7, 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



[issue18747] Re-seed OpenSSL's PRNG after fork

2019-01-04 Thread Gabriel Corona


Gabriel Corona  added the comment:

Now that the default PRNG of the 'random' package is automatically reseeded at 
fork, wouldn't it make sense to reseed the OpenSSL seed as well?

(At the same time the OpenSSL wiki states [1] that "The situation has changed 
greatly, starting with OpenSSL 1.1.1 which completely rewrote RNG. The concerns 
[of fork unsafety] do not really apply any more".)

[1] https://wiki.openssl.org/index.php/Random_fork-safety

--
nosy: +Gabriel Corona

___
Python tracker 

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



[issue35643] SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py

2019-01-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Would not be better to just remove a backslash?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35638] Introduce fixed point locale aware format type for floating point numbers

2019-01-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You can use locale.format_string() for locale aware formatting.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32660] Solaris should support constants like termios' FIONREAD

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue35616] Change references to '4.0'.

2019-01-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Removing the C API function is a major breaking change. AFAIK there was no 
precedence since 3.0. It may be that we will name the new version 4.0 after 
doing this.

In any case, first than remove this API, we need to pass the following steps:

* Implement Py_DEPRECATED on Windows and use it for *all* deprecated functions.
* Get rid of using deprecated API in the core and stdlib. I'm working on this.
* I think it is good idea to implement a custom build without wchar_t cache and 
deprecated API for testing with third-party code. I'm working on this.

One or two versions after using Py_DEPRECATED for all deprecated functions (but 
not earlier than EOL of 2.7) we can make them issuing run-time warnings. One or 
two versions after this we can replace them with stub functions that always 
fail. I think they can be removed after around 5 years from now. Currently we 
do not have exact terms. I do not see a problem with using 4.0 as a 
hypothetical removal term.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35634] kwargs regression when there are multiple entries with the same key

2019-01-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Serhiy, nosying you because Ammar identified your commit as relevant.
https://github.com/python/cpython/commit/e036ef8fa29f27d57fe9f8cef8d931d4122d8223
---

3.6 is also security-fix only.

Normally, code bug reports need a minimal, reproducible, initially-failing test 
case that only uses the stdlib, not 3rd party code.  A test case would have to 
include a simplified version of a multidict.

The problem here is that a multidict with duplicate keys is not a proper 
mapping, in spite of having a MutableMapping interface.  (Just curious, what 
does d['a'] return?). 

The purpose of the package is to meet the needs of HTTP Headers and URL query 
strings (and other situations) where the 'keys' are value-type tags, not true 
mapping keys.  Another example would be a bibliography entry that tags each of 
multiple author names with 'Author:'.  (Aside: A deficiency of git (github) is 
allowing only 1 author key and only one github username as the value.)

Is an object with duplicate keys legal for **expression in calls?
https://docs.python.org/3/reference/expressions.html#index-48
says that expression must evaluate to a 'mapping'.  The glossary entry
https://docs.python.org/3/glossary.html#term-mapping says
"A container object that supports arbitrary key lookups and implements the 
methods specified in the Mapping or MutableMapping abstract base classes." 
followed by unique-key examples.  To me, 'key lookup' implies unique keys.  The 
Mapping functions include 'keys' and 'items'.  What signature?  To return 
set-like views, the keys should be unique.

If we take the call to be a bug, is CPython *obligated* to immediately raise an 
exception?  In other words, must every call with **mapping take the time to 
check for duplicates because someone might pass a dup-key 'mapping'.

--
nosy: +serhiy.storchaka, terry.reedy
stage:  -> test needed
versions: +Python 3.7, Python 3.8 -Python 3.6

___
Python tracker 

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



[issue35639] Lowecasing Unicode Characters

2019-01-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Latin Capital Letter I with Dot Above

___
Python tracker 

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



[issue35649] http.client doesn't close. Infinite loop

2019-01-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue35651] PEP 257 (active) references PEP 258 (rejected) as if it were active

2019-01-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Guido, you are the

--
nosy: +goodger, gvanrossum, terry.reedy
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



[issue35651] PEP 257 (active) references PEP 258 (rejected) as if it were active

2019-01-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg333003

___
Python tracker 

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



[issue35654] Remove 'guarantee' that sorting only relies on __lt__ from sorting howto

2019-01-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue35657] multiprocessing.Process.join() ignores timeout if child process use os.exec*()

2019-01-04 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +davin, pitrou
stage:  -> needs patch
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



[issue35657] multiprocessing.Process.join() ignores timeout if child process use os.exec*()

2019-01-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I'm in favor of #1 *and* not documenting it either.  I don't think it's 
reasonable for the documentation to enumerate all the kinds of situations where 
executing arbitrary code in a child process might lead to dysfunction.

Realistically, if you want to spawn a subprocess, you should just use 
subprocess, not multiprocessing + exec().

In other words, I'd like to close this issue as "won't fix" if nobody objects.

--

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2019-01-04 Thread STINNER Victor

STINNER Victor  added the comment:

Computing the geometric mean of numbers require to compute the product of these 
numbers:
https://en.wikipedia.org/wiki/Geometric_mean

The geometric mean can be used to summarize benchmark results using different 
units to get a single number.

--

When computing the product of floats, is there a smart implementation reducing 
the error? I'm asking because math.fsum() doesn't use a naive loop but a smart 
implementation to minimize the error.

--

Mark Dickinson:
> On this subject, some effort has been made in the past to make (almost) all 
> the math module functions behave consistently with respect to things like 
> exceptions, overflow, infinities, nans, signed zeros, etc.

"versus"

Rémi Lapeyre:
> A naive implementation would also support user-defined types which would 
> probably be a good thing IMO

Would it make sense to only implement product for an iterable of floats, as 
math.fsum()?

--
nosy: +vstinner

___
Python tracker 

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



[issue35616] Change references to '4.0'.

2019-01-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

After reading Serhiy's explanation, I agree that '4.0' is better than a 
specific '3.nn'.  I did not realize how much was still left to be done.  We can 
revisit this when there is a definite removal date.  A literal 'sometime' might 
be better, but not worth arguing for.  Most of the other occurrences of '4.0' 
are related to the old unicode API.

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



[issue35657] multiprocessing.Process.join() ignores timeout if child process use os.exec*()

2019-01-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue35606] Add prod() function to the math module

2019-01-04 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I agree with Mark that correctness, rather than performance, should be the main 
attraction of a stdlib implementation.

By the way "prod" is slightly obscure (though it's Numpy's chosen spelling), 
how about "product"?  After all, we went with the full "factorial".

--
nosy: +pitrou

___
Python tracker 

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



[issue35622] RFE: Add os.sched_setattr() and os.sched_getattr() functions

2019-01-04 Thread STINNER Victor


Change by STINNER Victor :


--
title: Add support for Linux SCHED_DEADLINE -> RFE: Add os.sched_setattr() and 
os.sched_getattr() functions
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



[issue35611] open doesn't call IncrementalEncoder with final=True

2019-01-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue35627] multiprocessing.queue in 3.7.2 doesn't behave as it was in 3.7.1

2019-01-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue35627] multiprocessing.queue in 3.7.2 doesn't behave as it was in 3.7.1

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

mp_hang.py: I created the example into a script, I added the __main__ section 
described by Antoine. I cannot reproduce the bug on the Python master branch on 
Linux.

@June Kim: What is the output when it hangs? Can you try your example without 
VS Code? For example, try to run it in a cmd.exe terminal?

--
Added file: https://bugs.python.org/file48023/mp_hang.py

___
Python tracker 

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



[issue35635] asyncio.create_subprocess_exec() only works in main thread

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

> Am I missing something ? Given the complexity of this, I would expect this to 
> be better documented in the sections explaining how `asyncio.subprocess` and 
> `threading` interact.

The current documentation says:

"To handle signals and to execute subprocesses, the event loop must be run in 
the main thread."

https://docs.python.org/dev/library/asyncio-dev.html#concurrency-and-multithreading

But I agree that the doc can be enhanced :-) Do you have suggestions?

--
nosy: +vstinner

___
Python tracker 

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



[issue35635] asyncio.create_subprocess_exec() only works in main thread

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

By the way, asyncio doc is outdated:
"The default asyncio event loop implementation on Windows does not support 
subprocesses. Subprocesses are available for Windows if a ProactorEventLoop is 
used. See Subprocess Support on Windows for details."
https://docs.python.org/dev/library/asyncio-subprocess.html#creating-subprocesses

It's no longer true in Python 3.8:

"Changed in version 3.8: On Windows, ProactorEventLoop is now the default event 
loop."
https://docs.python.org/dev/library/asyncio-platforms.html

--

___
Python tracker 

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



[issue35627] multiprocessing.queue in 3.7.2 doesn't behave as it was in 3.7.1

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

I ran mp_hang.py on Windows 10 with Python 3.7.2: the script completes (it 
doesn't hang). The issue might be specific to VS Code (on Windows?).

--

___
Python tracker 

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



[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

bpo-35629 has been marked as a duplicate of this issue.

--

___
Python tracker 

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



[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest you to write:

with multiprocessing.Pool(4) as pool: result = tuple(pool.imap(print, (1, 2, 
3)))

On Python 3.8, your example will now log a resource warning since you don't 
close/terminate explicitly the pool.

--
nosy: +vstinner

___
Python tracker 

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



[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread Anthony Sottile


Anthony Sottile  added the comment:

If you see the bottom of my issue, I've suggested (nearly) the same thing -- 
though I require python2.x compatibility so I'm using `contextlib.closing`

--

___
Python tracker 

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



[issue35633] test_eintr fails on AIX since fcntl functions were modified

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

Does the test pass if you open the file in read+write ("w+b") mode rather than 
write-only ("wb") mode?

I'm talking about this line:

open(support.TESTFN, 'wb')

Note: if you want to test, you have the modify the mode twice:
  "with open('%s', 'wb') as f:" % support.TESTFN,
and
  with open(support.TESTFN, 'wb') as f:

--
nosy: +vstinner

___
Python tracker 

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



[issue35633] test_eintr: test_lockf() fails with "PermissionError: [Errno 13] Permission denied" on AIX

2019-01-04 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_eintr fails on AIX since fcntl functions were modified -> 
test_eintr: test_lockf() fails with "PermissionError: [Errno 13] Permission 
denied" on AIX

___
Python tracker 

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



[issue18747] Re-seed OpenSSL's PRNG after fork

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

The issue is closed. If you want to change anything, please open a new issue. 
IMHO this issue is too long, it's better to start a fresh issue with up to date 
info, just mention this old issue: bpo-18747.

--

___
Python tracker 

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



[issue35616] Change references to '4.0'.

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

I disagree. It's acceptable to break the C API in a minor release if the change 
has been properly promoted, documented, announced, etc.

IMHO breaking the C API in 4.0 is going to send a bad signal to users.

Multiple core developers asked multiple times to wait until Python 2 is really 
dead before removing some features which are used on Python 2 and Python 3. So 
at least, we must wait until January 1st, 2020, before removing Py_UNICODE APIs.

I also would like to see the deprecation warning supported on Windows.

I didn't see any announcement of future removal of C API on the capi-sig 
mailing list.

--

___
Python tracker 

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



[issue35616] Change references to '4.0'.

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

> One or two versions after using Py_DEPRECATED for all deprecated functions 
> (but not earlier than EOL of 2.7) we can make them issuing run-time warnings.

Maybe we can experiment adding warnings only in development mode, when python3 
-X dev is used?

> I'm working on this.

Thanks :-)

--

___
Python tracker 

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



[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm using `contextlib.closing`

Oh, I missed that: good!

--

___
Python tracker 

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



[issue35633] test_eintr: test_lockf() fails with "PermissionError: [Errno 13] Permission denied" on AIX

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

Previous discussion at:
https://bugs.python.org/issue35189#msg332580

--

___
Python tracker 

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



[issue35189] PEP 475: fnctl functions are not retried if interrupted by a signal (EINTR)

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

Michael created bpo-35633: test_eintr: test_lockf() fails with 
"PermissionError: [Errno 13] Permission denied" on AIX.

--

___
Python tracker 

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



[issue8538] Add FlagAction to argparse

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue since it seems like there are people requesting the feature. 
(I also removed myself from the issue, I'm not interested to implement it.)

--
resolution: out of date -> 
status: closed -> open

___
Python tracker 

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



[issue13927] Document time.ctime format

2019-01-04 Thread STINNER Victor


Change by STINNER Victor :


--
title: Extra spaces in the output of time.ctime -> Document time.ctime format
versions:  -Python 3.2, Python 3.3, Python 3.4, 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



[issue35432] str.format and string.Formatter bug with French (and other) locale

2019-01-04 Thread STINNER Victor

STINNER Victor  added the comment:

This bug is a duplicate of bpo-33954. Good news: it's now fixed in Python 3.6.8!

https://docs.python.org/3.6/whatsnew/changelog.html#python-3-6-8-release-candidate-1

"bpo-33954: For str.format(), float.__format__() and complex.__format__() 
methods for non-ASCII decimal point when using the “n” formatter."

Note: I fixed other bugs with special locales (mostly LC_NUMERIC and/or 
LC_MONETARY using a different encoding than the LC_CTYPE locale).

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
superseder:  -> float.__format__('n') fails with _PyUnicode_CheckConsistency 
assertion error for locales with non-ascii thousands separator

___
Python tracker 

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



[issue35659] Add heapremove() function to heapq

2019-01-04 Thread Wanja Chresta


New submission from Wanja Chresta :

Heap Queues are extremely useful data structures. They can, for example, be 
used to implement Dijkstra's algorithm for finding the shortest paths between 
nodes in a graph in O(edge * log vertices) time instead of (edge * vertices) 
without heaps.

One operation such implementations need, though, is the possibility to modify 
an element in the heap (and thus having to reorder it afterwards) in O(log n) 
time. One can model such an operation by removing a specific element from the 
heap and then adding the modified element.

So far, heapq only allows removing the first element through heappop; this is 
not what we need. Instead, we would want to support a heapremove function that 
removes an arbitrary element in the heap (if it exists) and raises ValueError 
if the value is not present.

list.remove cannot be used, since it needs O(n) time.

heapremove can be easily implemented by using bisect.bisect_left since heap is 
always sorted:

def heapremove(heap, x):
  i = bisect.bisect_left(heap, x)
  if heap[i] == x:
del heap[i]
  else:
raise ValueError

c.f. remove method in 
https://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html

--
components: Library (Lib)
messages: 333024
nosy: Wanja Chresta
priority: normal
severity: normal
status: open
title: Add heapremove() function to heapq
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



[issue35659] Add heapremove() function to heapq

2019-01-04 Thread Wanja Chresta


Change by Wanja Chresta :


--
type:  -> enhancement

___
Python tracker 

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



[issue28108] Python configure fails to detect tzname on platforms that have it.

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-35385.

--

___
Python tracker 

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



[issue35385] time module: why not using tzname from the glibc?

2019-01-04 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-28108.

--

___
Python tracker 

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



[issue33987] IDLE: use ttk.Frame for ttk widgets

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
pull_requests: +10859

___
Python tracker 

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



[issue33987] IDLE: use ttk.Frame for ttk widgets

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
pull_requests: +10859, 10860

___
Python tracker 

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



[issue33987] IDLE: use ttk.Frame for ttk widgets

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
pull_requests: +10859, 10860, 10861

___
Python tracker 

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



[issue33987] IDLE: use ttk.Frame for ttk widgets

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
pull_requests:  -10860

___
Python tracker 

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



[issue35659] Add heapremove() function to heapq

2019-01-04 Thread Wanja Chresta


Wanja Chresta  added the comment:

After thinking about it some more I realised that this doesn't make sense since 
heapq is based on lists and lists have an insertion complexity of O(n). Thus, 
they'll never read the needed O(log n) and heapq is the wrong place.

Never mind.

--
resolution:  -> wont fix
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



[issue33987] IDLE: use ttk.Frame for ttk widgets

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
pull_requests:  -10861

___
Python tracker 

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



[issue35660] IDLE: Remove import * from window.py

2019-01-04 Thread Cheryl Sabella


New submission from Cheryl Sabella :

Remove use of `from tkinter import *` from windows.py.

--
assignee: terry.reedy
components: IDLE
messages: 333028
nosy: cheryl.sabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Remove import * from window.py
type: enhancement
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



[issue35660] IDLE: Remove import * from window.py

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue35660] IDLE: Remove import * from window.py

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +patch, patch
pull_requests: +10862, 10863
stage:  -> patch review

___
Python tracker 

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



[issue35660] IDLE: Remove import * from window.py

2019-01-04 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
keywords: +patch, patch, patch
pull_requests: +10862, 10863, 10864
stage:  -> patch review

___
Python tracker 

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



  1   2   >