[issue35551] Encoding and alias issues

2019-06-05 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset cb65202520e7959196a2df8215692de155bf0cc8 by Inada Naoki in branch 
'master':
bpo-35551: remove mac_centeuro encoding (GH-13856)
https://github.com/python/cpython/commit/cb65202520e7959196a2df8215692de155bf0cc8


--

___
Python tracker 

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



[issue37168] Decimal divisions sometimes 10x or 100x too large

2019-06-05 Thread Tim Peters


Tim Peters  added the comment:

Also basic:  run hardware CPU and memory stress diagnostics, and/or try running 
the same thing on a different machine.  Hardware isn't infallible, and can fail 
in nearly arbitrary ways.  For example, perhaps a smidgen of silicon has gone 
flaky, so that one time in a billion bit 0 "leaks" into bit 1 in a register.  
That can effectively change the integer 1 to the integer 2.

Is that likely?  No.  But a loop doing mutually inconsistent things to the 
variables it's changing is impossible ;-)

--
nosy: +tim.peters

___
Python tracker 

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



[issue37162] new importlib dependencies csv, email and zipfile

2019-06-05 Thread Matthias Klose


Matthias Klose  added the comment:

yes, that's for the minimal package.

zipfile is found in Lib/importlib/_bootstrap_external.py

Again, it's just a question here, having found an unmotivated distutils import 
before in one of the standard modules.

--
resolution:  -> not a bug

___
Python tracker 

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



[issue35551] Encoding and alias issues

2019-06-05 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +13731
pull_request: https://github.com/python/cpython/pull/13856

___
Python tracker 

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



[issue36422] tempfile.TemporaryDirectory() removes entire directory tree even if it's a mount-point

2019-06-05 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

Since tempfile.TemporaryDirectory() already returns some exceptions to the 
caller when it can't figure out how to delete a directory item, I don't see a 
problem with throwing PermissionError when encountering a mount point. This 
would preserve the 'rm -rf' semantics of the underlying shutil.rmtree() calls.

--

___
Python tracker 

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



[issue32884] Adding the ability for getpass to print asterisks when passowrd is typed

2019-06-05 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

See also #36566. (Thanks Cheryl.)

I think the usability improvement for this far outweigh the decrease in 
security.

The days where somebody looking over your shoulder watching you type your 
password was the major threat are long gone. Hiding the length of the password 
against a shoulder-surfing adversary is so-1970s :-)

For old-school Unix types we ought to default to hiding the password. But I'm 
+1 in allowing developers to choose to trade off a tiny decrease in security 
against a major increase in usability.

The bottom line is that if you have a weak password, hiding the length won't 
save you; if you have a strong password, hiding the length doesn't add any 
appreciable difficulty to the attacker.

--
nosy: +steven.daprano
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Brian Skinn


Brian Skinn  added the comment:

Brett, to be clear, this sounds like the tabbed solution is not going to be 
used at this point? If so, I'll pull down the tabbed docs I'm hosting.

--

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-06-05 Thread Aaron Meurer


Aaron Meurer  added the comment:

I agree with Raymond that third party libraries are not ready for this. 

My biggest issue is that the way Python warns about this makes it very 
difficult for library authors to fix this. Most won't even notice. The problem 
is the warnings are only shown once, when the file is compiled. So if you run 
the code in any way that causes Python to compile it, a further run of 'python 
-Wd' will show nothing. I don't know if it's reasonable, but it would be nice 
if Python recompiled when given -Wd, or somehow saved the warning so it could 
be shown if that flag is given later.

As an anecdote, for SymPy's CI, we went through five (if I am counting 
correctly) iterations of trying to test this. Each of the first four were 
subtly incorrect, until we finally managed to find the correct one (for 
reference, 'python -We:invalid -m compileall -f -q module/').  So most library 
authors who will attempt to add tests against this will get it wrong. Simply 
adding -Wd as you would expect is wrong. If the code is already compiled (which 
it probably is, e.g., if you ran setup.py), it won't show the warnings. At the 
very least the "correct" way to test this should be documented. 

Things would probably be improved if the warnings were always shown, as at 
least then devs will see the error once (although most will probably be 
confused when the warning doesn't repeat).

Another problem is the information in the warnings. It seems the line number of 
the string is now shown, which is an improvement 
(https://bugs.python.org/issue28128). It would be nice if it showed the actual 
line and column number in the file of the invalid escape. This is especially 
annoying when an escape appears in a docstring. It just shows """ as the 
offending line. 

We have a lot of LaTeX in our docstrings in SymPy, so we had quite a few of 
these to fix. SymPy doesn't have invalid escapes anymore because I was 
proactive about it, but from what I've seen, most library authors haven't been.

By the way, this looks like a bug (python 3.8b1):

$ cat test.py

"""
a
\p
"""
$ python -We:invalid test.py
  File "test.py", line 2













  












  










  

[issue24231] os.makedirs('/', exist_ok=True) fails on Darwin

2019-06-05 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +Jeffrey.Kintscher

___
Python tracker 

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



[issue33010] os.path.isdir() returns True for broken directory symlinks or junctions

2019-06-05 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +Jeffrey.Kintscher

___
Python tracker 

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



[issue35669] tar symlink

2019-06-05 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +Jeffrey.Kintscher

___
Python tracker 

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



[issue37169] test_pyobject_is_freed_free fails with 3.8.0beta1

2019-06-05 Thread Matej Cepl


New submission from Matej Cepl :

When building openSUSE package for Python-3.8.0b1 (on x86_64 build system with 
the latest openSUSE/Tumbleweed) in the package which previously worked all the 
way up to 3.8.0.a4, I get this test failing:

[ 5771s] ==
[ 5771s] FAIL: test_pyobject_is_freed_free 
(test.test_capi.PyMemMallocDebugTests)
[ 5771s] --
[ 5771s] Traceback (most recent call last):
[ 5771s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.0b1/Lib/test/test_capi.py", line 729, 
in test_pyobject_is_freed_free
[ 5771s] self.check_pyobject_is_freed('pyobject_freed')
[ 5771s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.0b1/Lib/test/test_capi.py", line 720, 
in check_pyobject_is_freed
[ 5771s] assert_python_ok('-c', code, PYTHONMALLOC=self.PYTHONMALLOC)
[ 5771s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.0b1/Lib/test/support/script_helper.py", 
line 157, in assert_python_ok
[ 5771s] return _assert_python(True, *args, **env_vars)
[ 5771s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.0b1/Lib/test/support/script_helper.py", 
line 143, in _assert_python
[ 5771s] res.fail(cmd_line)
[ 5771s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.0b1/Lib/test/support/script_helper.py", 
line 70, in fail
[ 5771s] raise AssertionError("Process return code is %d\n"
[ 5771s] AssertionError: Process return code is 1
[ 5771s] command line: ['/home/abuild/rpmbuild/BUILD/Python-3.8.0b1/python', 
'-X', 'faulthandler', '-c', '\nimport gc, os, sys, _testcapi\n# Disable the GC 
to avoid crash on GC collection\ngc.disable()\nobj = 
_testcapi.pyobject_freed()\nerror = (_testcapi.pyobject_is_freed(obj) == 
False)\n# Exit immediately to avoid a crash while deallocating\n# the invalid 
object\nos._exit(int(error))\n']
[ 5771s] 
[ 5771s] stdout:
[ 5771s] ---
[ 5771s] 
[ 5771s] ---
[ 5771s] 
[ 5771s] stderr:
[ 5771s] ---
[ 5771s] 
[ 5771s] ---
[ 5771s] 
[ 5771s] --

--
components: Interpreter Core
messages: 344782
nosy: mcepl
priority: normal
severity: normal
status: open
title: test_pyobject_is_freed_free fails with 3.8.0beta1
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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread miss-islington


miss-islington  added the comment:


New changeset 23f41a64ea668296fa89e25f3cfa11f63026ecac by Miss Islington (bot) 
in branch '3.8':
bpo-37134: Use PEP570 syntax for sum() (GH-13851)
https://github.com/python/cpython/commit/23f41a64ea668296fa89e25f3cfa11f63026ecac


--
nosy: +miss-islington

___
Python tracker 

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



[issue37165] Convert _collections._count_elements() to the Argument Clinic

2019-06-05 Thread miss-islington


miss-islington  added the comment:


New changeset 21ce2454de57caaa532d11d76544632608f4b86b by Miss Islington (bot) 
in branch '3.8':
bpo-37165: Convert _count_elements to the argument clinic (GH-13848)
https://github.com/python/cpython/commit/21ce2454de57caaa532d11d76544632608f4b86b


--
nosy: +miss-islington

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13730
pull_request: https://github.com/python/cpython/pull/13854

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c4c421d619baf2ff2f7e09f55b7ae22b8f863c7b by Pablo Galindo in 
branch 'master':
bpo-37134: Use PEP570 syntax for sum() (GH-13851)
https://github.com/python/cpython/commit/c4c421d619baf2ff2f7e09f55b7ae22b8f863c7b


--

___
Python tracker 

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



[issue37165] Convert _collections._count_elements() to the Argument Clinic

2019-06-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13729
pull_request: https://github.com/python/cpython/pull/13853

___
Python tracker 

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



[issue37165] Convert _collections._count_elements() to the Argument Clinic

2019-06-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e985804207473796a1326585b3e1b9e18c764345 by Raymond Hettinger in 
branch 'master':
bpo-37165: Convert _count_elements to the argument clinic (GH-13848)
https://github.com/python/cpython/commit/e985804207473796a1326585b3e1b9e18c764345


--

___
Python tracker 

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



[issue37168] Decimal divisions sometimes 10x or 100x too large

2019-06-05 Thread Stefan Krah


Stefan Krah  added the comment:

Thank you for the detailed report. So, in an attempt to summarize,
this is the crucial passage:

>>> ideal_exp = -1
>>> exp = -29
>>> coeff = 15
>>> division_counter = 0
>>> while exp < ideal_exp and coeff % 10 == 0:
... coeff //= 10
... exp += 1
... division_counter += 1
... 
>>> coeff
15L
>>> exp
-1
>>> division_counter
28



But you sometimes get coeff==150 and division_counter==27 instead.
Is that correct?


The first thing to consider is whether Alpine Linux uses a patched
Python version or if you can reproduce this on Python 2.7.15 compiled
from source.

--

___
Python tracker 

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



[issue36422] tempfile.TemporaryDirectory() removes entire directory tree even if it's a mount-point

2019-06-05 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

(correcting typos)

What would be the appropriate behavior when unmount_func() fails (e.g. for a 
permission error)? Right now, any exceptions other than IsADirectoryError, 
PermissionError, and FileNotFoundError are passed on to the caller.

--

___
Python tracker 

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



[issue36422] tempfile.TemporaryDirectory() removes entire directory tree even if it's a mount-point

2019-06-05 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

Only deleting from the local filesystem seems reasonable to me. In the context 
of a temporary directory tree, I don't see a semantic difference between 
"unmounting a mount point" and "removing a subdirectory entry" -- i.e. they 
both remove the offending subdirectory tree from the temporary directory tree.

Internally, tempfile.TemporaryDirectory() calls shutil.rmtree() with a custom 
error handler. The handler tries to reset the permissions on the offending 
entry and calls os.unlink(). If this throws an error, it recursively calls 
shutil.rmtree() on the offending entry (ignoring the temp directory entry 
itself). This seems like where a mounted directory tree would get deleted.

shutil.rmtree() follows the "rm -rf" semantics and refuses to delete a mount 
point. It seems reasonable to me to add special handling for mount points to 
the error handler in tempfile.TemporaryDirectory(). The high-level logic would 
be something like:

if os.path.ismount(path):
try:
unmount_func(path)
_shutil.rmtree(path)
except FileNotFoundError:
pass

The tricky part is implementing unmount_func() in a portable manner since there 
is no such functionality currently implemented in the Python library.

Also, what would be the appropriate behavior when unmount_func() fails (e.g. 
for a permission error)? Right now, any exceptions other than 
IsADirectoryError, IsADirectoryError, and FileNotFoundError are passed on to 
the caller.

--

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +13728
pull_request: https://github.com/python/cpython/pull/13851

___
Python tracker 

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



[issue37168] Decimal divisions sometimes 10x or 100x too large

2019-06-05 Thread Phil Frost


Phil Frost  added the comment:

I should note that while we do observe this issue with Decimal, my 
troubleshooting so far indicates the logic in decimal.py is fine. It seems 
instead the instructions in decimal.py aren't being correctly executed.

I'm not sure if the problem is limited to only Decimal, or if we just notice it 
there because it's correlated with financial code, which when encountering the 
bug, introduces an error which is eventually caught by the accounting 
department. There could very well be errors happening at least frequently 
elsewhere which simply go unnoticed.

--

___
Python tracker 

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



[issue35551] Encoding and alias issues

2019-06-05 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



[issue35551] Encoding and alias issues

2019-06-05 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset c4c15ed7a2c7c2a1983e88b89c244d121eb3e512 by Cheryl Sabella 
(Ashwin Ramaswami) in branch 'master':
bpo-35551: encodings update (GH-11446)
https://github.com/python/cpython/commit/c4c15ed7a2c7c2a1983e88b89c244d121eb3e512


--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue37168] Decimal divisions sometimes 10x or 100x too large

2019-06-05 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +facundobatista, mark.dickinson, rhettinger, skrah

___
Python tracker 

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



[issue37168] Decimal divisions sometimes 10x or 100x too large

2019-06-05 Thread Phil Frost


New submission from Phil Frost :

We've observed instances of Decimal divisions being incorrect a few times per 
day in a web application serving millions of requests daily. I've been unable 
to reproduce the issue but have been investigating core dumps which suggest 
either some issue in the C Python implementation or its execution environment.

Python 2.7.15 on Alpine Linux Docker containers.

A slightly modified decimal.py is attached. It's been modified to check that 
the answer is approximately correct and dumps core if not. It also has a few 
local variables added to provide additional insight. I've annotated the file 
with values from the core dump and my reasoning about what should happen.

The crux of the problem is the loop at line 1389. There are 3 ways to determine 
how many times this loop executed:

1. the number of zeros removed from coeff
2. the number of times exp is incremented
3. the number of times division_counter is incremented

Oddly, #1 and #3 indicate the loop happened 27 times, while #2 indicates the 
loop happened 28 times.

One possible explanation (which makes about as much sense as any other) is that 
`exp += 1` sometimes adds 2 instead of 1. This means the loop happens 1 time 
fewer than it should, leaving `coeff` 10 times bigger than it should properly 
be. Or (very rarely) this happens twice and the result is 100 times bigger.

I find it very odd that something as basic as `+= 1` should not work, but at 
the moment it is the best explanation I have.

Unfortunately I can't share the core dump, as I've only been able to observe 
the issue in production so the core contains private information. But I'd 
welcome any ideas for further exploration. Or perhaps someone is aware of an 
existing bug that would explain this behavior.

--
components: Interpreter Core
files: decimal.py
messages: 344772
nosy: Phil Frost
priority: normal
severity: normal
status: open
title: Decimal divisions sometimes 10x or 100x too large
versions: Python 2.7
Added file: https://bugs.python.org/file48396/decimal.py

___
Python tracker 

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



[issue37166] inspect.findsource doesn't handle shortened files gracefully

2019-06-05 Thread Michael Bejda


Change by Michael Bejda :


--
keywords: +patch
pull_requests: +13727
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13850

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

IIUC sum() should also have a slash in the middle.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue37130] pathlib.with_name() doesn't like unnamed files.

2019-06-05 Thread N.P. Khelili


N.P. Khelili  added the comment:

The idea in my last post was quite bad,
setting name to None breaks a lot of functions
that expect name to be a string.

Path('.').parent and Path('..').parent both return '.'.

Even if it is not stupid (regarding them as special dirs
pointing to somewhere else but still being inside the directory).

I don't know why anyone would rely on such a behaviour...

The tests expect Path('..').stem() to be '..'
and expect Path('.').stem() to be ''

Once again, I don't know why anyone should rely on it but
I fear I can't do a lot without breaking this one part of the test.

I'm working on it and posting something by the end of the Week.

--

___
Python tracker 

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



[issue37167] Cannot build Windows python_d.exe in master branch

2019-06-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I looked more carefully and all the errors were for files in the external 
xz-5.2.2 directory.  I deleted it to force a fresh download and a rebuild 
worked fine. Sorry for the noise.

--
resolution:  -> not a bug
stage: needs patch -> 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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Gregory P. Smith


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



[issue37129] Add RWF_APPEND flag

2019-06-05 Thread YoSTEALTH


Change by YoSTEALTH :


--
nosy: +YoSTEALTH

___
Python tracker 

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



[issue37167] Cannot build Windows python_d.exe in master branch

2019-06-05 Thread Terry J. Reedy


New submission from Terry J. Reedy :

In master, pcbuild/build -e -d (the 2nd run) gave the errors in 
build_errors.txt. Many or most were like

f:\dev\3x\externals\xz-5.2.2\src\liblzma\common\block_encoder.h(1): error C2018
: unknown character '0x2' [F:\dev\3x\PCbuild\liblzma.vcxproj]

>chkdsk found no problems.

A fix is high priority for me because my most recent 3.8.0a4 build in master, 
on 6/2, no longer imports tkinter.  Hence IDLE fails also.

>>> import tkinter
Traceback (most recent call last):
  File "", line 1, in 
  File "F:\dev\3x\lib\tkinter\__init__.py", line 36, in 
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: Module use of python39_d.dll conflicts with this version of Python.

Building python_d.exe for 3.8 and 3.7 had no problem.

--
components: Build, Windows
files: build_errors.txt
messages: 344768
nosy: paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Cannot build Windows python_d.exe in master branch
type: compile error
versions: Python 3.9
Added file: https://bugs.python.org/file48395/build_errors.txt

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Carol Willing


Carol Willing  added the comment:


New changeset 54edb04aa688c8247570b4f59b5145e3fa417576 by Carol Willing (Pablo 
Galindo) in branch 'master':
bpo-37134: Add PEP570 notation to the documentation (GH-13743)
https://github.com/python/cpython/commit/54edb04aa688c8247570b4f59b5145e3fa417576


--

___
Python tracker 

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



[issue37166] inspect.findsource doesn't handle shortened files gracefully

2019-06-05 Thread SilentGhost


SilentGhost  added the comment:

3.6 is in security-only mode, this doesn't look like a security issue to me

--
nosy: +SilentGhost, yselivanov
versions: +Python 3.9 -Python 3.6

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thank you very much, everyone, for sharing your comments, views and concerns 
and thanks to the steering council for helping to reach a conclusion. 

I have updated PR13743 to only modify the functions that fall into the second 
point of Brett's message as indicated.

--

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 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



[issue33725] Python crashes on macOS after fork with no exec

2019-06-05 Thread miss-islington


miss-islington  added the comment:


New changeset d74438b633184bbd8d775d7118d6f12f6f825a96 by Miss Islington (bot) 
in branch '3.8':
bpo-33725, multiprocessing doc: rephase warning against fork on macOS (GH-13841)
https://github.com/python/cpython/commit/d74438b633184bbd8d775d7118d6f12f6f825a96


--

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 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



[issue33725] Python crashes on macOS after fork with no exec

2019-06-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13726
pull_request: https://github.com/python/cpython/pull/13849

___
Python tracker 

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



[issue33725] Python crashes on macOS after fork with no exec

2019-06-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1e77ab0a35cf95318bb4893f7253a30f73201163 by Victor Stinner in 
branch 'master':
bpo-33725, multiprocessing doc: rephase warning against fork on macOS (GH-13841)
https://github.com/python/cpython/commit/1e77ab0a35cf95318bb4893f7253a30f73201163


--

___
Python tracker 

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



[issue37166] inspect.findsource doesn't handle shortened files gracefully

2019-06-05 Thread Tim Hatch


Change by Tim Hatch :


--
type:  -> behavior

___
Python tracker 

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



[issue37166] inspect.findsource doesn't handle shortened files gracefully

2019-06-05 Thread Tim Hatch


New submission from Tim Hatch :

inspect.findsource() can trigger IndexError when co_firstlineno is larger than 
len(linecache.getlines()).

If you have a situation where the file that linecache finds doesn't match the 
imported module, then you're not guaranteed that co_firstlineno on the code 
objects makes any sense.  We hit this in a special kind of par file, but it 
could be triggered by shortening the file, like doing a git checkout of an 
older version while it's running.

a.py (3 lines):
# line 1
# line 2
def foo(): pass  # co_firstlineno=3

a.py.v2 (1 line):
def foo(): pass

repro:
import a
# modification happens, cp a.py.v2 a.py
inspect.getsource(a.foo)


Although linecache.getline() does bounds checking, `inspect.findsource()` 
(which is used by various other functions, including `inspect.stack()`) grabs 
all the lines and loops through them.  The bug is in this section of 
`inspect.py`:

if iscode(object):
if not hasattr(object, 'co_firstlineno'):
raise OSError('could not find function definition')
lnum = object.co_firstlineno - 1
pat = 
re.compile(r'^(\s*def\s)|(\s*async\s+def\s)|(.*(? 0:
if pat.match(lines[lnum]): break
lnum = lnum - 1
return lines, lnum
raise OSError('could not find code object')

Found through future.utils.raise_from which actually doesn't need to be using 
`inspect.stack()`, it can switch to `sys._getframe(2)` or so.  We should have a 
PR ready shortly, but wondering if this can be backported to at least 3.6?

--
components: Library (Lib)
messages: 344761
nosy: lisroach, thatch, vstinner
priority: normal
severity: normal
status: open
title: inspect.findsource doesn't handle shortened files gracefully
versions: 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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Steve Dower


Steve Dower  added the comment:

> So it's really FD_SETSIZE that matters, and it's a compile-time constant.

The only way this constant can matter is if the array has to end with an empty 
slot, which doesn't appear to be the case. The pre-compiled function can't tell 
how you compiled the code calling it, and the only place where FD_SETSIZE is 
used is in the macros to set them.

Dynamic allocation ought to be just fine, and likely faster for big arrays.

--

___
Python tracker 

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



[issue37165] Convert _collections._count_elements() to the Argument Clinic

2019-06-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +13725
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13848

___
Python tracker 

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



[issue37165] Convert _collections._count_elements() to the Argument Clinic

2019-06-05 Thread Raymond Hettinger


New submission from Raymond Hettinger :

This lets _count_elements use METH_FASTCALL.

--
components: Library (Lib)
messages: 344759
nosy: rhettinger
priority: normal
severity: normal
status: open
type: performance
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy: +eryksun

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

> The actual number of descriptors is passed in

Yes, but:

"""The nfds parameter is included only for compatibility with Berkeley 
sockets."""

... according to 
https://docs.microsoft.com/en-us/windows/desktop/api/Winsock2/nf-winsock2-select

So it's really FD_SETSIZE that matters, and it's a compile-time constant.

Note that Anaconda has been doing this for a long time:
https://github.com/AnacondaRecipes/python-feedstock/blob/master/recipe/0004-Win32-Change-FD_SETSIZE-from-512-to-2048.patch

--
nosy:  -eryksun

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Eryk Sun


Eryk Sun  added the comment:

> It doesn't have to. The actual number of descriptors is passed in, and 

To clarify, this is the fd_count in each fd_set, i.e. Winsock uses a counted 
SOCKET array instead of the bitmask that's found on other platforms. Winsock 
select() ignores nfds [1].

If Python's select module used a dynamic fd_set in Windows, this entails 
directly initializing fd_count and fd_array. The FD_SET macro can't be used 
since it's intended for the static definition and limited to FD_SETSIZE. 
FD_ZERO, FD_ISSET, and FD_CLR should still work.

[1] 
https://docs.microsoft.com/en-us/windows/desktop/api/winsock2/nf-winsock2-select

--
nosy: +eryksun

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

>From my understanding Steve is right.

--

___
Python tracker 

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



[issue37068] Emit SyntaxWarning for f-strings without expressions ?

2019-06-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Adding my agreement that this is a feature, not a bug.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37162] new importlib dependencies csv, email and zipfile

2019-06-05 Thread Brett Cannon


Brett Cannon  added the comment:

The imports are on purpose but they are not required for import to run, just 
like importlib.resources isn't necessary.

--

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Brett Cannon


Brett Cannon  added the comment:

To help short-circuit this discussion and focus on the desired solution, the 
steering council came to a decision that can be seen at 
https://github.com/python/steering-council/issues/12#issuecomment-498874939 :

- for Python 3.8 specifically, we think it makes sense to continue to leave the 
slashes out of the documentation for the all parameters are positional-only 
case (i.e. "... , /)") and the all parameters are positional-only & 
keyword-only case (i.e. "..., /, *, ..." and "..., /, *args, ..."). This 
question can then be revisited for Python 3.9.

- however, we actively want to see them added for the cases where an API has a 
mixture of positional-only and positional-or-keyword args (i.e. "..., /, ...")

- we'd like to see the rendered documentation for function signatures enhanced 
to use tooltips to name the positional-only (bare "/"), keyword-only (bare 
"*"), additional positional args (named "*"), and additional keyword args 
(named "**") notations (hyperlinking to a glossary entry could also be 
interesting, but may be too visually noisy based on how the hyperlinks get 
rendered)

--

___
Python tracker 

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



[issue36839] Support the buffer protocol in code objects

2019-06-05 Thread Brett Cannon


Brett Cannon  added the comment:

"I'm sorry, I thought "fantasy" was good metaphor."

No problem! Saying something is "fantasy" like "it's based on fantasy" -- in 
North America at least -- is like saying "you're fooling yourself" or "you're 
delusional".

--

___
Python tracker 

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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-05 Thread Brett Cannon


Brett Cannon  added the comment:

+1 for Serhiy's suggestion

--
nosy: +brett.cannon

___
Python tracker 

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



[issue18299] Change script_helper to use universal_newlines=True in _assert_python

2019-06-05 Thread hai shi


Change by hai shi :


--
keywords: +patch
pull_requests: +13724
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/13847

___
Python tracker 

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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-06-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13723
pull_request: https://github.com/python/cpython/pull/13846

___
Python tracker 

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



[issue21315] email._header_value_parser does not recognise in-line encoding changes

2019-06-05 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:


New changeset 66c4f3f38b867d8329b28c032bb907fd1a2f22d2 by Barry Warsaw 
(Abhilash Raj) in branch 'master':
bpo-21315: Fix parsing of encoded words with missing leading ws. (#13425)
https://github.com/python/cpython/commit/66c4f3f38b867d8329b28c032bb907fd1a2f22d2


--

___
Python tracker 

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



[issue35551] Encoding and alias issues

2019-06-05 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

1. Background for "tactis":

https://github.com/python/cpython/commit/4fd73f0465ba11c22f0986d04cf91b387ed22c47

# The codecs for these encodings are not distributed with the
# Python core, but are included here for reference, since the
# locale module relies on having these aliases available.

This codec was available as separate package at the time. Later the CJK codecs 
got added to the stdlib, but this codec was not.

I guess it's fine to remove the alias.

2. If the mappings are identical, just leaving one and making the other an 
alias is fine. Same for aliases of those mapping names.

3. I think we had already resolved this some time ago.

--

___
Python tracker 

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



[issue18299] Change script_helper to use universal_newlines=True in _assert_python

2019-06-05 Thread hai shi


hai shi  added the comment:

>it's a pain to extend the API (I don't want to use yet another __xxx custom 
>keyword)
Adding __xxx in run_python_until_end function would increase the complexity but 
it looks like a unified function.

--
nosy: +shihai1991

___
Python tracker 

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



[issue37158] Speed-up statistics.fmean()

2019-06-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I can close it now :-)

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



[issue37158] Speed-up statistics.fmean()

2019-06-05 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Nice! On my computer, I get about 30% speed up. Thanks Raymond.

The two PRs are status "merged". Does this mean we can close this ticket or is 
there more to do? (The git workflow is still a mystery to me.)

--

___
Python tracker 

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



[issue37089] `import Lib.os` works on windows (but shouldn't)

2019-06-05 Thread Steve Dower


Steve Dower  added the comment:

There are certainly people relying on sys.prefix being in sys.path (for .pth 
files and embedding), but probably not so many that we couldn't remove it in a 
major release. It is a bit strange in a venv, where there's typically nothing 
in the root of the environment (when we discovered this, we decided we could 
stop copying all the modules over, as they weren't being used anyway).

I think in every supported distribution we make though, there's no need for it. 
But we'd probably have to just remove it and see what breaks - most of the 
people relying on it probably have no idea, but they're also probably bundling 
it in some way that makes it easy to detect and fix.

All that said, I'm not particularly offended by this. It's namespace packages 
working as intended, and since it seems to be a highly complex interaction of 
configuration settings to get sys.prefix on sys.path in a variety of 
circumstances (we're not relying on registry settings here any more) I'd want 
to see changes and tests before assuming we can do it without regressing real 
scenarios.

--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Steve Dower


Steve Dower  added the comment:

> How does select() know the FD_SETSIZE?

It doesn't have to. The actual number of descriptors is passed in, and the API 
presumably assumes that FD_SETSIZE is bigger than that (or else the caller 
would have crashed writing to invalid memory).

I don't see why we'd make it a parameter though. If we have all the 
descriptors, just allocate a big enough array and pass it in?

--

___
Python tracker 

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



[issue34222] Email message serialization enters an infinite loop when folding non-ASCII headers with long words

2019-06-05 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thanks for the report, @maxking.

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue34222] Email message serialization enters an infinite loop when folding non-ASCII headers with long words

2019-06-05 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> [security] Infinite loop on folding email (_fold_as_ew()) if an 
header has no spaces

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13722
pull_request: https://github.com/python/cpython/pull/13845

___
Python tracker 

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



[issue37163] dataclasses.replace() fails with the field named "obj"

2019-06-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I propose to add a deprecation warning in 3.8 and use the PEP 570 syntax in 3.9 
(which means a TypeError if obj is passed by keyword argument).

--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote a proof-of-concept: PR 13845.

... but now I'm confused. How does select() know the FD_SETSIZE? Is it 
hardcoded in select() ABI? Does this PR work? Or does it make no sense?

--

___
Python tracker 

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



[issue37162] new importlib dependencies csv, email and zipfile

2019-06-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have not found zipfile here.

email is used for parsing METADATA and PKG-INFO. It replaces the rfc822 module.

cvs is used for parsing RECORD and SOURCES.txt. Actually using it for for 
parsing SOURCES.txt is improper as it might contain double quotes or 
backslashes (unlikely but possible).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37134] Use PEP570 syntax in the documentation

2019-06-05 Thread Brian Skinn


Brian Skinn  added the comment:

First, for anyone interested, there are screenshots and links to docs versions 
at the SC GH issue 
(https://github.com/python/steering-council/issues/12#issuecomment-498856524, 
and following) where we're exploring what the tabbed approach to the PEP570 
docs might look like.

Second, I'd like to suggest an additional aspect of the docs situation for 
consideration.

Regardless of which specific approach is decided upon here, it seems likely the 
consensus will be a course of action requiring touching the majority 
(entirety?) of the stdlib API docs. Currently, all of the API docs are manually 
curated in the .rst, at minimum for the reasons laid out by Victor in bpo25461 
(https://bugs.python.org/issue25461#msg253381). If there's any chance that the 
balance of factors has changed such that using autodoc (or similar) *would* now 
be preferable, IWSTM that now is a good time to have that discussion, so that 
an autodoc conversion could be done at the same time as the PEP570 rework.

--

___
Python tracker 

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



[issue37152] Add AF_LOCAL alias for AF_UNIX

2019-06-05 Thread Christian Heimes


Christian Heimes  added the comment:

You are welcome! :)

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue22117] Rewrite pytime.h to work on nanoseconds

2019-06-05 Thread STINNER Victor


STINNER Victor  added the comment:

> Right, but my question was very specifically about a test added for this 
> issue.

This issue is about nanoseconds. I looked again and I found the commit  
https://hg.python.org/cpython/rev/b0b4c4d365b1 related to this issue.

So to reply to your question, honestly, I don't recall why I had to replace 
sleep() with gmtime(): all I know is written in the comment. But Python 
internals changed *a lot* since 2015...

My comment is more general: closed issues are hidden from bugs.python.org home 
page, so only people in the nosy list get a notification. The discussion is 
"hidden". Since issue is 4 years old, some people in the nosy list no longer 
contribute to Python.

Moreover, the bug tracker is usually not a good place to ask a question. I 
prefer to only use it to discuss bugs.

--

___
Python tracker 

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



[issue37152] Add AF_LOCAL alias for AF_UNIX

2019-06-05 Thread carlo


carlo  added the comment:

> I'm -1 to add the alias. It just adds to the confusion. It's also against the 
> Zen of Python: "There should be one-- and preferably only one --obvious way 
> to do it."

Agreed with the zen of python.

This is my first PR / issue, thanks for the fast reply.

You may close this issue )

--

___
Python tracker 

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



[issue36974] Implement PEP 590

2019-06-05 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +13721
pull_request: https://github.com/python/cpython/pull/13844

___
Python tracker 

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



[issue37116] Use PEP 570 syntax for positional-only parameters

2019-06-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Separate issues should be open for remaining cases. For example issue37163 is 
open for dataclasses.replace().

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



[issue37116] Use PEP 570 syntax for positional-only parameters

2019-06-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 142566c028720934325f0b7fe28680afd046e00f by Serhiy Storchaka in 
branch 'master':
[3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)
https://github.com/python/cpython/commit/142566c028720934325f0b7fe28680afd046e00f


--

___
Python tracker 

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



[issue37158] Speed-up statistics.fmean()

2019-06-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 9ddb77741e041966d64739353393bcba33cc3bdd by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-37158: Simplify and speed-up statistics.fmean() (GH-13832) (GH-13843)
https://github.com/python/cpython/commit/9ddb77741e041966d64739353393bcba33cc3bdd


--

___
Python tracker 

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



[issue37164] dict creation with converted zip objects produces inconsistent behavior

2019-06-05 Thread Dane Howard


Dane Howard  added the comment:

Yes, that seems to be it - in every case I was checking the value of c with 
`list(c)` and assuming that wouldn't change anything.

thanks!

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



[issue37162] new importlib dependencies csv, email and zipfile

2019-06-05 Thread Anthony Sottile


Anthony Sottile  added the comment:

at least for debian, the motivation is to provide a `pythonX.X-minimal` and a 
`pythonX.X` package -- the former ~mostly just contains the interpreter and the 
latter includes the stdlib

(I'm interested as well, hit this packaging 3.8 for deadsnakes)

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue37164] dict creation with converted zip objects produces inconsistent behavior

2019-06-05 Thread Paul Moore


Paul Moore  added the comment:

Works fine for me:

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a = ['1','2','3']
>>> b = [1,2,3]
>>> c = zip(a,b)
>>> print(dict(list(c)))
{'1': 1, '2': 2, '3': 3}
>>> print(dict(list(zip(a,b
{'1': 1, '2': 2, '3': 3}
>>> d = zip(b,a)
>>> print(dict(list(d)))
{1: '1', 2: '2', 3: '3'}

Are you sure you didn't try to use c twice? If you do, it will start up from 
where it left off (at the end) and so generate no further values:

>>> print(dict(list(c)))
{}

You need to remember that c is an iterator, and this is how iterators work. (If 
you're coming from Python 2, this is new behaviour in Python 3).

--
resolution:  -> not a bug

___
Python tracker 

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



[issue37164] dict creation with converted zip objects produces inconsistent behavior

2019-06-05 Thread Dane Howard


New submission from Dane Howard :

confirmed on the following versions:
3.6.3 (Windows 10)
3.7.0 (Debian 9 & Windows 10)
3.7.1 (Debian 9)
a dictionary created with the dict() function will not always return the 
appropriate dictionary object. The following code produces the bug on all 
stated versions except 3.6.3/Win10, which exhibits slightly different behavior.

a = ['1','2','3']
b = [1,2,3]
c = zip(a,b)
print(dict(list(c))) #gives empty dict
print(dict(list(zip(a,b #gives {'1':1,'2':2,'3':3}
d = zip(b,a)
print(dict(list(d))) #gives {1:'1',':'2',3:'3'}

--
components: Windows
files: pybug.png
messages: 344729
nosy: Dane Howard, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: dict creation with converted zip objects produces inconsistent behavior
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48394/pybug.png

___
Python tracker 

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



[issue37162] new importlib dependencies csv, email and zipfile

2019-06-05 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

I imagine that importlib.metadata isn’t imported at bootstrap time, only after 
the import infrastructure is ready. I think an early failure to import one of 
those dependencies is desirable. What is the reasoning behind deferring the 
imports and why does it apply to this module?

--

___
Python tracker 

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



[issue37149] link to official documentation tkinter failed !!!

2019-06-05 Thread Guilloux

Guilloux  added the comment:

I have received the answer :

Objet:  Re: Request about a broken link on your website.
Date:   2019-06-05 16:39
De: New Mexico Tech 
À:  xav...@guilloux-fr.net
Cc: thomas.guenger...@nmt.edu, webmas...@nmt.edu



Hello,
Unfortunately infohost.nmt.edu has been shut down and we will no longer be 
supporting that website. The website will not be coming back up. Sorry for the 
inconvenience.  

-Dorothy 

ITC-UC
NMIMT
Socorro, NM 87801
575-835-5700

--

___
Python tracker 

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



[issue37158] Speed-up statistics.fmean()

2019-06-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 6c01ebcc0dfc6be22950fabb46bdc10dcb6202c9 by Raymond Hettinger in 
branch 'master':
bpo-37158: Simplify and speed-up statistics.fmean() (GH-13832)
https://github.com/python/cpython/commit/6c01ebcc0dfc6be22950fabb46bdc10dcb6202c9


--

___
Python tracker 

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



[issue37158] Speed-up statistics.fmean()

2019-06-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13720
pull_request: https://github.com/python/cpython/pull/13843

___
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-06-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue37149] link to official documentation tkinter failed !!!

2019-06-05 Thread Guilloux

Guilloux  added the comment:

I have read Cheryl Sabella's comment. So I have sent this e-mail :

Objet:  Request about a broken link on your website.
Date:   2019-06-05 16:20
De: xav...@guilloux-fr.net
À:  thomas.guenger...@nmt.edu, webmas...@nmt.edu, h...@nmt.edu


Hello,

For several days the link 
"https://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html; has stopped 
working. But this link provided access to a prodigious technical documentation 
related to a Python language module (tkinter).

Can you put this link back in working order (or place a redirect to the new 
link)?

I draw your attention to the fact that this documentation contributes 
significantly to the international recognition of your university.

Thanks a lot for the continuation that you will give to this request.

Regards.

Xavier Guilloux.

(following is the same message but in my natural language - French -)

Bonjour,

Depuis plusieurs jours le lien 
"https://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html; ne fonctionne 
plus. Or ce lien permettait d'accéder à une prodigieuse documentation technique 
en rapport avec un module du langage Python (tkinter).

Pouvez-vous remettre ce lien en état de fonctionnement (ou placer une 
redirection vers le nouveau lien) ?

J'attire votre attention sur le fait que cette documentation contribue de 
manière importante à la reconnaissance internationale de votre université.

Merci par avance pour la suite que vous donnerez à cette requête.

Cordialement.

Xavier Guilloux.

--

___
Python tracker 

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



[issue37150] Do not allow to pass FileType class object instead of instance in add_argument

2019-06-05 Thread Demid


Demid  added the comment:

What if I will add mode check in FileType.__init__?

--

___
Python tracker 

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



[issue2771] Test issue

2019-06-05 Thread Ernest W. Durbin III


Ernest W. Durbin III  added the comment:

test comment

--

___
Python tracker 

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



[issue2771] Test issue

2019-06-05 Thread Ernest W. Durbin III


Ernest W. Durbin III  added the comment:

test comment

--

___
Python tracker 

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



[issue36624] cleanup the stdlib and tests with regard to sys.platform usage

2019-06-05 Thread Steve Dower


Steve Dower  added the comment:

The reason I'd prefer sys.platform in most cases is because it's a compile-time 
constant, based on the one that includes/excludes APIs near completely, and 
most of our tests ought to be switching on these.

I personally don't see any need to switch on os.name, except perhaps in the 
tests for that module.

But if we start skipping tests based on platform(), then we will miss out on 
seeing new failures on new platforms. This is a real concern, as I have 
colleagues currently adding Windows on ARM and ARM64 support, and since the API 
is the same we expect everything to work. It doesn't, of course, but that's 
what specific exclusions are for.

If I were to propose a consistent scheme for this, I'd suggest:
* include tests based on sys.platform
* skip tests based on platform module

So if some functionality only exists when MS_WINDOWS was defined, we check 
sys.platform == win32. But if it doesn't work on ARM, we check 
platform.platform == (whatever the value is).

That way, adding new platforms will get the maximum amount of tests initially.

--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I believe the number still can be configurable but requires more work.

The idea is:
FD_* macroses should be replaced with custom fd_set manipulation functions.
on select.select() call we can calculate the number of the highest used socket 
and use this number plus 1 as fd_set structure size.

Did not try to prototype it though.

--
nosy: +asvetlov

___
Python tracker 

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



[issue37149] link to official documentation tkinter failed !!!

2019-06-05 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

This reference was hosted at a university called New Mexico Tech.  I've been 
trying to determine if this server is just offline or if it's being sunsetted.  
Many google search results still point to infohost.mnt.edu or redirect to that 
page (not just the tkinter link).  Also, their main webpage (www.nmt.edu) also 
has a search that redirects results to infohost, so those links are all broken 
as well.

It seems to me that they just haven't stood up the new site yet or else they 
haven't changed their redirect, so I would assume that once they find they have 
broken links, they will fix this.  However, I also found an article that the 
creator of the tkinter docs has passed away [1].  If the infohost subdomain was 
his, then they might be moving all of it.

Anyway, I think we should leave the docs as they are for now with the hope they 
the university will fix the redirect.  If it doesn't get resolved, then we 
probably need to reach out to them.  Since the author is deceased, I'm not sure 
how it would work to try to host it somewhere else.  It would be a shame to 
lose this valuable reference and work.

[1] https://www.nmt.edu/news/2019/nmt_dedicates_shipman_plaque.php

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue22117] Rewrite pytime.h to work on nanoseconds

2019-06-05 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Right, but my question was very specifically about a test added for this issue. 
So asking it here first made sense to me. If nobody would reply, I could still 
ask somewhere else.

In the end, Petr solved the problem anyway, so the question is irrelevant now.

--

___
Python tracker 

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



[issue22117] Rewrite pytime.h to work on nanoseconds

2019-06-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Because this reduces the number of people which can notice your comment. Active 
core developers receive too much messages. Currently I have 473 unread messages 
from b.p.o (out of 22425) and 299 unread messages from GitHub (out of 20476). 
And this is only for open and recently closed issues (messages for closed 
issues are manually moved to other folders). There are also separate folders 
for other projects, mailing lists, etc. It is not surprising if I miss some 
messages.

--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Andrei Zene


Andrei Zene  added the comment:

> Would it be possible to make FD_SETSIZE configurable at runtime, at least on 
> Windows? IMHO it would be a better approach.

That would be awesome, but it doesn't look like it would be possible. As I have 
already pointed out in my previous comment:

> I'm not sure this can be totally dynamic on Windows. The problem is the 
> fd_set struct which is defined in Winsock2.h
>
> typedef struct fd_set {
> u_int fd_count;   /* how many are SET? */
> SOCKET  fd_array[FD_SETSIZE];   /* an array of SOCKETs */
> } fd_set;
>
> The heap-allocated pylists are converted into fd_set structs which are always 
> allocated on the stack btw. The problem is there's no way to create a fd_set 
> of a desired FD_SETSIZE at runtime.

--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread STINNER Victor


STINNER Victor  added the comment:

Would it be possible to make FD_SETSIZE configurable at runtime, at least on 
Windows? IMHO it would be a better approach.

--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2019-06-05 Thread Andrei Zene


Andrei Zene  added the comment:

We would also need this limit to be raised. We are using a server that was 
implemented using tornado, and tornado uses select.select. 

> It looks like Modules/selectmodule.c already has the handling for when this 
> gets large (and we really want to stop allocating the static array on the 
> stack), which is a plus, but I'd want to see the performance cost to small 
> selects if suddenly we're allocating 100s of KB on the heap rather than small 
> and cheap stack allocations.

I gave this a try. The code I used for the server and the client for taken from 
this page: https://steelkiwi.com/blog/working-tcp-sockets/. I just added some 
code to measure the time it stays in the "select" call. To measure the time I 
used time.process_time(). I then connected/disconnected only 1 client 10.000 
times in a row, discarding the measurements of the first 1000 iterations 
(warm-up).

Here are the results:
FD_SETSIZE = 16384 bytes
Time elapsed (avg ns):  20029.566224207087
Time elapsed (max ns):  15625000
Time elapsed (min ns):  0

FD_SETSIZE = 512 bytes
Time elapsed (avg ns):  14671.361502347418
Time elapsed (max ns):  15625000
Time elapsed (min ns):  0

> However, I see no reason why this couldn't be totally dynamic, at least on 
> Windows. Redefining that value just changes a static array definition, but 
> the array size never gets passed in to the OS AFAICT, so there's no reason we 
> couldn't stack allocate for small select()s and heap allocate for big 
> select()s. That's considerably more work than anyone had in mind, I'd wager.
I'm not sure this can be totally dynamic on Windows. The problem is the fd_set 
struct which is defined in Winsock2.h

typedef struct fd_set {
u_int fd_count;   /* how many are SET? */
SOCKET  fd_array[FD_SETSIZE];   /* an array of SOCKETs */
} fd_set;

The heap-allocated pylists are converted into fd_set structs which are always 
allocated on the stack btw. The problem is there's no way to create a fd_set of 
a desired FD_SETSIZE at runtime.

I have also submitted a PR with the change for convenience: 
https://github.com/python/cpython/pull/13842.

--
nosy: +andzn

___
Python tracker 

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



  1   2   >