[issue39254] python shebang in python3 tarball files

2020-01-07 Thread Arkadiusz Miskiewicz Arkadiusz Miskiewicz


Arkadiusz MiskiewiczArkadiusz Miskiewicz 
 added the comment:

These look to be python2 files. Since python2 is close to EOL should these be 
ported to python3?

There are more of these in git:

Lib/encodings/rot_13.py \
Lib/lib2to3/tests/data/different_encoding.py \
Lib/lib2to3/tests/data/false_encoding.py \
Mac/BuildScript/build-installer.py \
Modules/_sha3/cleanup.py \
Objects/typeslots.py \
Parser/asdl_c.py \
Python/makeopcodetargets.py \
Tools/gdb/libpython.py \
Tools/pynche/pynche \
Tools/pynche/pynche.pyw \
Tools/scripts/2to3 \
Tools/scripts/smelly.py

--

___
Python tracker 

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



[issue39254] python shebang in python3 tarball files

2020-01-07 Thread Arkadiusz Miskiewicz Arkadiusz Miskiewicz


New submission from Arkadiusz Miskiewicz
Arkadiusz Miskiewicz :

Python 3.8.1 files:

Lib/encodings/rot_13.py \
Lib/lib2to3/tests/data/different_encoding.py \
Lib/lib2to3/tests/data/false_encoding.py \
Tools/gdb/libpython.py \
Tools/pynche/pynche \
Tools/pynche/pynche.pyw \
Tools/scripts/2to3 \
Tools/scripts/smelly.py \
python-gdb.py

are calling python (which often points to python2) while should be calling 
python3 explicitly (unless python2 is required for using these which would be 
weird in Python 3 package)

--
components: Build
messages: 359567
nosy: arekm
priority: normal
severity: normal
status: open
title: python shebang in python3 tarball files
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



[issue38623] Python documentation should mention how to find site-packages

2020-01-07 Thread Inada Naoki


Inada Naoki  added the comment:

> The tutorial currently mentions its special role only briefly [7], saying:
>
>> * The installation-dependent default.
>
> We should explain that part. I'll give it a shot replacing my earlier 
> proposal.

I don't think so.  At there, the tutorial doesn't explain about even standard 
library.  We shouldn't explain about it there.

It should be explained much later in the tutorial, or document other than the 
tutorial.

--

___
Python tracker 

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



[issue22107] tempfile module misinterprets access denied error on Windows

2020-01-07 Thread Jonathan Mills


Change by Jonathan Mills :


--
nosy: +Jonathan Mills

___
Python tracker 

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



[issue22107] tempfile module misinterprets access denied error on Windows

2020-01-07 Thread Jonathan Mills


Change by Jonathan Mills :


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



[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread Eryk Sun


Eryk Sun  added the comment:

I'd like to match POSIX here by supporting path-like names. Also, I think it 
would be cleaner to split out the platform-specific work into a separate 
_load_library method, like how subprocess.Popen is designed, and to stop 
pretending that WINAPI LoadLibraryEx is POSIX dlopen. For example:

if _os.name == "nt":
import nt as _nt
from _ctypes import LoadLibrary as _LoadLibrary
from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL
# ...
else:
from _ctypes import dlopen as _dlopen

# ...

class CDLL:
# ...

def __init__(self, name, mode=DEFAULT_MODE, handle=None,
 use_errno=False, use_last_error=False, winmode=None):

class _FuncPtr(_CFuncPtr):
_restype_ = self._func_restype_
_flags_ = self._func_flags_
if use_errno:
_flags_ |= _FUNCFLAG_USE_ERRNO
if use_last_error:
_flags_ |= _FUNCFLAG_USE_LASTERROR

self._FuncPtr = _FuncPtr
self._name = name
if handle is None:
self._handle = self._load_library(name, mode, winmode)
else:
self._handle = handle

if _os.name == "nt":
def _load_library(self, name, mode, winmode):
if winmode is None:
winmode = _nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
if name:
name = _os.fsdecode(name)
# WINAPI LoadLibrary searches for a DLL if the given name
# is not fully qualified with an explicit drive. For POSIX
# compatibility, and because the DLL search path no longer
# contains the working directory, begin by fully resolving
# any name that contains a path separator.
if '/' in name or '\\' in name:
name = _nt._getfullpathname(name)
# Given a fully-qualified DLL name, allow loading
# dependents from its directory.
winmode |= _nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
return _LoadLibrary(name, winmode)

else:
def _load_library(self, name, mode, winmode):
if _sys.platform.startswith("aix"):
# When the name contains ".a(" and ends with ")", for 
example,
# "libFOO.a(libFOO.so)" - this is taken to be an 
# archive(member) syntax for dlopen(), and the mode is
# adjusted. Otherwise, name is presented to dlopen() as a
# file argument.
if name and name.endswith(")") and ".a(" in name:
mode |= _os.RTLD_MEMBER | _os.RTLD_NOW
return _dlopen(name, mode)

--
nosy: +eryksun
stage:  -> test needed

___
Python tracker 

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



[issue35163] locale: setlocale(..., 'eo') sets non-existing locale

2020-01-07 Thread Carmen Bianca Bakker


Change by Carmen Bianca Bakker :


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

___
Python tracker 

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



[issue39247] dataclass defaults and property don't work together

2020-01-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

Your code basically becomes similar to this:

sentinel = object()

class FileObject:
_uploaded_by: str = None
uploaded_by = None

def __init__(self, uploaded_by=sentinel):
if uploaded_by is sentinel:
self.uploaded_by = FileObject.uploaded_by
else:
self.uploaded_by = uploaded_by

def save(self):
print(self.uploaded_by)

@property
def uploaded_by(self):
return self._uploaded_by

@uploaded_by.setter
def uploaded_by(self, uploaded_by):
print('Setter Called with Value ', uploaded_by)
self._uploaded_by = uploaded_by

Which has the same problem. I'll have to give it some thought.

--

___
Python tracker 

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



[issue39253] Running the test suite with --junit-xml and -R incorrectly reports refleaks

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Oh. That explains these strange results on AMD64 RHEL7 Refleaks 3.8:

https://buildbot.python.org/all/#/builders/219/builds/41

 argv: [b'make', b'buildbottest', b'TESTOPTS=-R 3:3 -u-cpu --junit-xml 
test-results.xml -j10 ${BUILDBOT_TESTOPTS}', b'TESTPYTHONOPTS=', 
b'TESTTIMEOUT=11700']

...
test_quopri leaked [168, 168, 168] references, sum=504
test_quopri leaked [75, 75, 75] memory blocks, sum=225
1:50:20 load avg: 1.06 Re-running test_future5 in verbose mode
test_future5 leaked [42, 42, 42] references, sum=126
test_future5 leaked [20, 20, 20] memory blocks, sum=60
...

The previous build is successful and it didn't use --junit-xml option:

https://buildbot.python.org/all/#/builders/219/builds/40

--

___
Python tracker 

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



[issue39253] Running the test suite with --junit-xml and -R incorrectly reports refleaks

2020-01-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is going to be very noisy now that we are using  --junit-xml in the 
buildbots...

--

___
Python tracker 

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



[issue39253] Running the test suite with --junit-xml and -R incorrectly reports refleaks

2020-01-07 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

./python -m test test_list -R : --junit-xml something
0:00:00 load avg: 0.52 Run tests sequentially
0:00:00 load avg: 0.52 [1/1] test_list
beginning 9 repetitions
123456789
.
test_list leaked [798, 798, 798, 798] references, sum=3192
test_list leaked [345, 345, 345, 345] memory blocks, sum=1380
test_list failed

== Tests result: FAILURE ==

1 test failed:
test_list

Total duration: 3.4 sec
Tests result: FAILURE

--
components: Tests
messages: 359561
nosy: pablogsal, steve.dower, vstinner
priority: normal
severity: normal
status: open
title: Running the test suite with --junit-xml and -R incorrectly reports 
refleaks
versions: Python 3.9

___
Python tracker 

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



[issue38623] Python documentation should mention how to find site-packages

2020-01-07 Thread Peter Bittner


Peter Bittner  added the comment:

Python learners deserve to know about "site-packages" and (optionally) 
"dist-packages". This is a "random note", it's an explanation that is missing 
in the tutorial.

- Site-packages "is the target directory of manually built Python packages", 
does someone explain.[4]

- It is the "expected convention for locally installed packages", explains Greg 
Ward in "Installing Python Modules".[5]

- Their location is only a subset of `sys.path`, as visible from the Python 
code in the `site` module.[6]

The tutorial currently mentions its special role only briefly [7], saying:

> * The installation-dependent default.

We should explain that part. I'll give it a shot replacing my earlier proposal.


[4] 
https://stackoverflow.com/questions/31384639/what-is-pythons-site-packages-directory
[5] https://docs.python.org/3.8/install/#modifying-python-s-search-path
[6] https://github.com/python/cpython/blob/master/Lib/site.py#L319-L344
[7] 
https://docs.python.org/3.8/tutorial/modules.html?highlight=installation-dependent%20default#the-module-search-path

--

___
Python tracker 

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



[issue27196] Eliminate 'ThemeChanged' warning when running IDLE tests

2020-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

2.7 EOL.

Ned, do you still see Themed Changed?  I don't on 3.8 on Macbook. with 10.14 
mohave(?)

--
versions: +Python 3.9 -Python 2.7, 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



[issue39229] library/functions.rst causes translated builds to fail

2020-01-07 Thread Julien Palard


Julien Palard  added the comment:

I've already seen Sphinx giving inconsistent warnings about inconsistent terms 
references, see https://github.com/sphinx-doc/sphinx/issues/3985.

I would recommand fixing all other warnings in the file first, then tell us how 
it goes.

--

___
Python tracker 

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



[issue38882] IDLE should not make About be a transient of withdrawn root window

2020-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

2.7 is EOL.

--
nosy:  -ronaldoussoren
title: IDLE should not make the about dialog be a transient of the withdrawn 
root window -> IDLE should not make About be a transient of withdrawn root 
window
versions:  -Python 2.7

___
Python tracker 

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



[issue21995] Idle: review 'missing' attributes of pseudofiles

2020-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I changed title to 'review' (TextIOBase doc and StringIO as a pure text 
implementation).

--
title: Idle: pseudofiles have no buffer attribute. -> Idle: review 'missing' 
attributes of pseudofiles
versions: +Python 3.9 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue39252] email.contentmanager.raw_data_manager bytes handler breaks on 7bit cte

2020-01-07 Thread Ryan McCampbell


New submission from Ryan McCampbell :

The email.contentmanager.set_bytes_content function which handles bytes content 
for raw_data_manager fails when passed cte="7bit" with an AttributeError: 
'bytes' object has no attribute 'encode'. This is probably not a major use case 
since bytes are generally not for 7-bit data but the failure is clearly not 
intentional.

--
components: Library (Lib)
messages: 359555
nosy: rmccampbell7
priority: normal
severity: normal
status: open
title: email.contentmanager.raw_data_manager bytes handler breaks on 7bit cte
type: behavior
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



[issue25178] IDLE: search regex errors should be in/attached to search dialog

2020-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I like the way that Open Module puts error messages in red under the entry box 
and allows users to correct without first clicking a modal message away.  I 
would like to do the same here.

--
assignee:  -> terry.reedy
nosy:  -kbk, roger.serwy
stage:  -> test needed
versions: +Python 3.9 -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



[issue24816] IDLE: disable selecting debugger when user code is running

2020-01-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee:  -> terry.reedy
stage:  -> needs patch
title: don't allow selecting IDLE debugger menu item when running -> IDLE: 
disable selecting debugger when user code is running
versions: +Python 3.9 -Python 2.7, 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



[issue24818] IDLE: run program in debugger from edit window

2020-01-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee:  -> terry.reedy
nosy:  -kbk, roger.serwy
title: no way to run program in debugger from edit window -> IDLE:  run program 
in debugger from edit window
versions: +Python 3.9 -Python 2.7, 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



[issue24799] IDLE should detect changes to open files by other processes

2020-01-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee:  -> terry.reedy
versions: +Python 3.9 -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



[issue24817] IDLE: disable format menu items when not applicable

2020-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The default selection is, now at least, the current line, so that every entry 
is always applicable.

--
assignee:  -> terry.reedy
nosy:  -kbk, roger.serwy
resolution:  -> works for me
stage:  -> resolved
status: open -> closed
title: disable format menu items when not applicable -> IDLE: disable format 
menu items when not applicable
versions: +Python 3.9 -Python 2.7, 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



[issue24815] On maxOS, IDLE app menu can become nearly blank

2020-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The nearly blank menu has the Apple icon and the IDLE dropdown.  I verified 
that this can be generated with either Debugger or IDLE Help, which are 
non-modal non-menu windows.

Currently, IDLE has a separate menu for each editor and output and the shell. 
On macOS, focusing on a menu window pastes that windows menu onto the app menu. 
 Focusing on a non-menu window leaves the app menu alone, leaving most items 
linked to the menu window that had the previous focus.  It is not especially 
good that a majority of menu items do not apply to the current focused window.

Closing a menu window whose menu is currently the app menu removes all but IDLE 
from the app menu.  Closing any window shifts focus, by default, back to the 
previous focused window.  So if an app menu window is closed and the previous 
window is not a menu window, the app menu is cleared and not re-painted.

The nearly blank menu looks odd, but is easily restored by focusing on a menu 
window.  To fix it anyway, we would have to explicitly focus on a remaining 
menu window when one is closed.  Or wait until IDLE's menus system is 
re-factored in such a way that blanking never occurs.

--
assignee:  -> terry.reedy
nosy:  -kbk, roger.serwy
title: IDLE can lose menubar on OS X -> On maxOS, IDLE app menu can become 
nearly blank
versions: +Python 3.9 -Python 2.7, 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



[issue39249] difflib SequenceMatcher 200 char length limitation for ratio calculation

2020-01-07 Thread Tim Peters


Tim Peters  added the comment:

Try passing

autojunk=False

to the SequenceMatcher constructor.

More on that here:

https://bugs.python.org/issue31889

--
nosy: +tim.peters

___
Python tracker 

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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

> Hm, I'm seeing _Py_CheckPython3() use Py_GetPrefix(), which uses 
> _Py_path_config.prefix?

Oh right, that's the initial issue:

> Later the interpreter tries to load python3.dll and uses dllpath which is 
> empty by default. This empty path gets joined with \python3.dll and 
> \DLLs\python3.dll which is used in the LoadLibraryExW resulting in loading 
> python3.dll from the root location of the windows drive the application is 
> running from.

I reopen the issue.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue23434] support encoded filename in Content-Disposition for HTTP in cgi.FieldStorage

2020-01-07 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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-07 Thread Anthony Wee


Anthony Wee  added the comment:

Hm, I'm seeing _Py_CheckPython3() use Py_GetPrefix(), which uses 
_Py_path_config.prefix?

https://github.com/python/cpython/blob/c02b41b1fb115c87693530ea6a480b2e15460424/PC/getpathp.c#L1185

--

___
Python tracker 

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



[issue39251] outdated windows store links in WindowsApps folder

2020-01-07 Thread Steve Dower


Steve Dower  added the comment:

These links are controlled by Microsoft, and not by us. (Though just to make 
things confusing, I am the person at Microsoft who can get them updated.)

We've been waiting for the ecosystem to be ready. Too many packages have been 
failing to install on Python 3.8 for us to want to switch, as we really don't 
want to drop new Python users into the depths of debugging packaging failures. 
I need to loop around and find out which ones are still problematic before 
making the final call.

--
resolution:  -> third party
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



[issue39251] outdated windows store links in WindowsApps folder

2020-01-07 Thread Brian McKim


New submission from Brian McKim :

When I uninstalled the windows store version 3.8 it appears to have placed two 
links in my \AppData\Local\Microsoft\WindowsApps folder (though they may have 
always been there), python.exe and python3.exe. When I run these in PowerShell 
both send me to the 3.7 version in the store. There is a note on the page 
stating this version is not guaranteed to be stable and points them to the 3.8 
version. As these are to make the install as painless as possible these should 
point to the most stable version; 3.8 in the store.

--
components: Windows
files: Annotation 2020-01-07 161226.png
messages: 359547
nosy: Brian McKim, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: outdated windows store links in WindowsApps folder
type: enhancement
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48831/Annotation 2020-01-07 161226.png

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-01-07 Thread Ned Deily


Change by Ned Deily :


--
components:  -macOS
nosy: +davin, pitrou -ned.deily, ronaldoussoren
versions: +Python 3.9

___
Python tracker 

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



[issue5233] IDLE: exec IDLESTARTUP/PYTHONSTARTUP on restart

2020-01-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue39248] test_distutils fails on PPC64 Fedora 3.x

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

The problem seems to be that /tmp/subprocess.py file exists: when 
/tmp/tmpo2bw8_ak.py temporary script was run, /tmp/subprocess.py was used 
rather than the subprocess of the stdlib.

--

___
Python tracker 

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



[issue39248] test_distutils fails on PPC64 Fedora 3.x

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like a change on the worker rather than in the code, since 3.7, 3.8 
and master branches are affected.

David Edelsohn: Would you mind to have a look at this issue?

PPC64 Fedora 3.7:
https://buildbot.python.org/all/#builders/32/builds/40

PPC64 Fedora 3.8:
https://buildbot.python.org/all/#/builders/118/builds/70

PPC64 Fedora 3.x:
https://buildbot.python.org/all/#/builders/8/builds/136

--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

> It looks like Py_SetPath() sets the _Py_path_config.prefix to "", but I'm not 
> seeing anything else set it to a real value?

In the master branch, _Py_CheckPython3() doesn't use _Py_path_config.prefix.

_PyPathConfig_InitDLLPath() calls GetModuleFileNameW(PyWin_DLLhModule, 
dll_path, MAXPATHLEN) if PyWin_DLLhModule is initialized.

For example, _PyPathConfig_InitDLLPath() is called by Py_Initialize() and 
Py_SetPath().

PyWin_DLLhModule is initialized by DllMain().

The code in the 3.8 branch looks very similar (I backported my "Remove 
_PyPathConfig.dll_path" change to 3.8: commit 
9f3dcf802eefeb5ab821ce3c7204ab46557d53d7).

--

___
Python tracker 

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



[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread David Heffernan


David Heffernan  added the comment:

I would approve of that

On Tue, 7 Jan 2020, 20:43 Steve Dower,  wrote:

>
> Steve Dower  added the comment:
>
> In that case, we should refactor the init method to check whether handle
> has been specified earlier, so that it's obvious that the two conditional
> blocks are never executed in that case.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39250] os.path.commonpath() not so common

2020-01-07 Thread Zachary Ware


Zachary Ware  added the comment:

No problem :)

--
resolution:  -> works for me
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



[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread Steve Dower


Steve Dower  added the comment:

In that case, we should refactor the init method to check whether handle has 
been specified earlier, so that it's obvious that the two conditional blocks 
are never executed in that case.

--

___
Python tracker 

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



[issue39250] os.path.commonpath() not so common

2020-01-07 Thread Filipp Lepalaan


Filipp Lepalaan  added the comment:

Hi Zach!

You're absolutely right. Forgive my ignorance. Too much staring at the trees 
and not seeing the forest (or vice versa).

commonpath() works as advertised. I'm just looking for something different.

Sorry for the false alarm. You can close this issue

--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-01-07 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



[issue39239] select.epoll.unregister(fd) should not ignore EBADF

2020-01-07 Thread STINNER Victor


Change by STINNER Victor :


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



[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread David Heffernan


David Heffernan  added the comment:

Personally I'd hang this off whether handle has been specified. It seems 
pointless to set the mode if you are never going to use it.

--

___
Python tracker 

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



[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2020-01-07 Thread Philippe Ombredanne

Philippe Ombredanne  added the comment:

Thank for the (re) explanation. Unicode is tough!
Basically this is the issue i have really in the end with the folding: what 
used to be a proper alpha string is not longer one after a lower() because the 
second codepoint is a punctuation and I use a regex split on the \W word class 
that then behaves differently when the string is lowercased as we have an extra 
punctuation then to break on. I will find a way around these (rare) cases 
alright! 

Sorry for the noise.

```
>>> 'İ'.isalpha()
True
>>> 'İ'.lower().isalpha()
False
```

--

___
Python tracker 

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



[issue39250] os.path.commonpath() not so common

2020-01-07 Thread Zachary Ware


Zachary Ware  added the comment:

I'm not seeing how `/var` has `/var/log` in common with `/var/log` and 
`/var/log/nginx`.

--
nosy: +zach.ware

___
Python tracker 

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



[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread Steve Dower


Change by Steve Dower :


--
keywords: +easy, newcomer friendly

___
Python tracker 

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



[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread Steve Dower


Steve Dower  added the comment:

Good catch.

We should probably make the line 351 check "if name and ('/' in name ..." like 
the others in the same function.

--
keywords: +3.8regression

___
Python tracker 

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



[issue37194] Move new vector private declarations to the internal C API

2020-01-07 Thread Nick Coghlan


Change by Nick Coghlan :


--
pull_requests:  -17306

___
Python tracker 

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



[issue39250] os.path.commonpath() not so common

2020-01-07 Thread Filipp Lepalaan


New submission from Filipp Lepalaan :

The documentation describes os.path.commonpath() as:

"Return the longest common sub-path of each pathname in the sequence paths. 
Raise ValueError if paths contain both absolute and relative pathnames, the 
paths are on the different drives or if paths is empty. Unlike commonprefix(), 
this returns a valid path."

However, in practice the function seems to always return the *shortest* common 
path. Steps to reproduce:

import os.path
paths = ['/var', '/var/log', '/var/log/nginx']
os.path.commonpath(paths)

Expected results:
'/var/log'

Actual results:
'/var'

I've tried this with Python 3.5, 3.6, 3.7 and 3.8.1 on both MacOS and 
Debian/Linux and the results are consistent.

--
components: Library (Lib)
messages: 359535
nosy: filipp
priority: normal
severity: normal
status: open
title: os.path.commonpath() not so common
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



[issue39161] Py_NewInterpreter docs need updating for multi-phase initialization

2020-01-07 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue39249] difflib SequenceMatcher 200 char length limitation for ratio calculation

2020-01-07 Thread Daniel Pezoa


New submission from Daniel Pezoa :

I am using the SequenceMatcher object of the difflib library and I have noticed 
that a drastic failure occurs when the text strings exceed 200 characters

Source code:
=

from difflib import SequenceMatcher

def main():
# Throw a value of 7% when they are almost equal for having more than 200 
characters
text1 = "aceite y pez hirviendo que vena de la plataforma y de la cual 
salan tambin muchsimas flechas rodeadas de estopas alquitranadas y encendidas 
que no podan desprenderse ni arrancarse sin quemarse las manos"
text2 = "aceite y pedir viendo que vena de la plataforma y de la cual salan 
tambin muchsimas flechas rodeadas de estopas alquitranadas y encendidas que no 
podan desprenderse ni arrancarse sin quemarse las manos"
m = SequenceMatcher(None, text1, text2)
x = m.ratio()
porcentaje = (int)(x * 100)
print("{}\n\n{}\n\n{}\n\nBad: {}%\n\n".format(text1, text2, x, porcentaje))

# Throw the expected value of 99% for having less than 200 characters
text1 = "aceite y pez hirviendo que vena de la plataforma y de la cual 
salan tambin muchsimas flechas rodeadas de estopas alquitranadas y encendidas 
que no podan desprenderse ni arrancarse sin quemarse las"
text2 = "aceite y pedir viendo que vena de la plataforma y de la cual salan 
tambin muchsimas flechas rodeadas de estopas alquitranadas y encendidas que no 
podan desprenderse ni arrancarse sin quemarse las"
text1 = "aceite y pez hirviendo que vena de la plataforma y de la cual 
salan tambin muchsimas flechas rodeadas de estopas alquitranadas"
text2 = "aceite y pedir viendo que vena de la plataforma y de la cual salan 
tambin muchsimas flechas rodeadas de estopas alquitranadas"
m = SequenceMatcher(None, text1, text2)
x = m.ratio()
porcentaje = (int)(x * 100)
print("{}\n\n{}\n\n{}\n\nGood: {}%".format(text1, text2, x, porcentaje))


if __name__== "__main__":
main()


Output:
==

aceite y pez hirviendo que vena de la plataforma y de la cual salan tambin 
muchsimas flechas rodeadas de estopas alquitranadas y encendidas que no podan 
desprenderse ni arrancarse sin quemarse las manos

aceite y pedir viendo que vena de la plataforma y de la cual salan tambin 
muchsimas flechas rodeadas de estopas alquitranadas y encendidas que no podan 
desprenderse ni arrancarse sin quemarse las manos

0.0794044665012407

Bad: 7%


aceite y pez hirviendo que vena de la plataforma y de la cual salan tambin 
muchsimas flechas rodeadas de estopas alquitranadas

aceite y pedir viendo que vena de la plataforma y de la cual salan tambin 
muchsimas flechas rodeadas de estopas alquitranadas

0.9800796812749004

Good: 98%

--
components: Library (Lib)
messages: 359534
nosy: Daniel Pezoa
priority: normal
severity: normal
status: open
title: difflib SequenceMatcher 200 char length limitation for ratio calculation
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



[issue39247] dataclass defaults and property don't work together

2020-01-07 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue23434] support encoded filename in Content-Disposition for HTTP in cgi.FieldStorage

2020-01-07 Thread R. David Murray


R. David Murray  added the comment:

Are you saying there is no (http) RFC compliant way to fix this, or no way to 
fix it with the email library parsers?  If the latter, the library is pretty 
flexible and for internal stdlib use it would probably be permissible to 
directly call methods in the internal parsing module, if those would be useful.

I haven't re-read the issue to reload my brain, so this question may be off 
point (except for the first clause of the question).

--

___
Python tracker 

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



[issue23147] Possible error in _header_value_parser.py

2020-01-07 Thread R. David Murray


R. David Murray  added the comment:

Thanks for the ping.  Whether or not Serhiy's patch fixed the original problem, 
the algorithm rewrite has happened so this issue is no longer relevant in any 
case.

--
stage: test needed -> 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



[issue39247] dataclass defaults and property don't work together

2020-01-07 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue39248] test_distutils fails on PPC64 Fedora 3.x

2020-01-07 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/8/builds/136

0:11:37 load avg: 2.21 [230/420/1] test_distutils failed
Traceback (most recent call last):
  File "/tmp/tmpo2bw8_ak.py", line 5, in 
byte_compile(files, optimize=1, force=None,
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/distutils/util.py",
 line 359, in byte_compile
import subprocess
  File "/tmp/subprocess.py", line 28
"""Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API

call(...): Runs a command, waits for it to complete, then returns
the return code.
check_call(...): Same as call() but raises CalledProcessError()
if return code is not 0
check_output(...): Same as check_call() but returns the contents of
stdout instead of a return code
Popen(...): A class for flexibly executing a command in a new process

Constants
-
PIPE:Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout
"""Instruction context:
   ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "/tmp/tmpkoui1d2n.py", line 5, in 
byte_compile(files, optimize=1, force=None,
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/distutils/util.py",
 line 359, in byte_compile
import subprocess
  File "/tmp/subprocess.py", line 28
"""Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API

call(...): Runs a command, waits for it to complete, then returns
the return code.
check_call(...): Same as call() but raises CalledProcessError()
if return code is not 0
check_output(...): Same as check_call() but returns the contents of
stdout instead of a return code
Popen(...): A class for flexibly executing a command in a new process

Constants
-
PIPE:Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout
"""Instruction context:
   ^
SyntaxError: invalid syntax
error: command 
'/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/python' failed 
with exit status 1
error: Bad exit status from /var/tmp/rpm-tmp.yc4Iwj (%install)
Bad exit status from /var/tmp/rpm-tmp.yc4Iwj (%install)
Traceback (most recent call last):
  File "/tmp/tmp6h6zfdg2.py", line 5, in 
byte_compile(files, optimize=1, force=None,
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/distutils/util.py",
 line 359, in byte_compile
import subprocess
  File "/tmp/subprocess.py", line 28
"""Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API

call(...): Runs a command, waits for it to complete, then returns
the return code.
check_call(...): Same as call() but raises CalledProcessError()
if return code is not 0
check_output(...): Same as check_call() but returns the contents of
stdout instead of a return code
Popen(...): A class for flexibly executing a command in a new process

Constants
-
PIPE:Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout
"""Instruction context:
   ^
SyntaxError: invalid syntax
error: command 
'/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/python' failed 
with exit status 1
error: Bad exit status from /var/tmp/rpm-tmp.ccdCTP (%install)
Bad exit status from /var/tmp/rpm-tmp.ccdCTP (%install)
Traceback (most recent call last):
  File "/tmp/tmp_slztuax.py", line 5, in 
byte_compile(files, optimize=1, force=None,
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/distutils/util.py",
 line 359, in byte_compile
import subprocess
  File "/tmp/subprocess.py", line 28
"""Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API

call(...): Runs a command, waits for it to complete, then returns
the return code.
check_call(...): Same as call() but raises CalledProcessError()
if return code is not 0
check_output(...): Same as check_call() but returns the contents of
stdout instead of a return code
Popen(...): A class for flexibly executing a command in a new process

Constants
-
PIPE:Special value that 

[issue37194] Move new vector private declarations to the internal C API

2020-01-07 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +17311
pull_request: https://github.com/python/cpython/pull/17893

___
Python tracker 

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



[issue38871] lib2to3 generates invalid code with filter and ternary operator

2020-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 39a5c889d30d03a88102e56f03ee0c95db198fb3 by Miss Islington (bot) 
in branch '3.8':
bpo-38871: Fix lib2to3 for filter-based statements that contain lambda 
(GH-17780)
https://github.com/python/cpython/commit/39a5c889d30d03a88102e56f03ee0c95db198fb3


--

___
Python tracker 

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



[issue38871] lib2to3 generates invalid code with filter and ternary operator

2020-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 535a3c4e3da2f0076bd62f04fb2cc44999fc2419 by Miss Islington (bot) 
in branch '3.7':
bpo-38871: Fix lib2to3 for filter-based statements that contain lambda 
(GH-17780)
https://github.com/python/cpython/commit/535a3c4e3da2f0076bd62f04fb2cc44999fc2419


--
nosy: +miss-islington

___
Python tracker 

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



[issue39247] dataclass defaults and property don't work together

2020-01-07 Thread Michael Robellard


New submission from Michael Robellard :

I ran into a strange issue while trying to use a dataclass together with a 
property.

I have it down to a minumum to reproduce it:

import dataclasses

@dataclasses.dataclass
class FileObject:
_uploaded_by: str = dataclasses.field(default=None, init=False)
uploaded_by: str = None

def save(self):
print(self.uploaded_by)

@property
def uploaded_by(self):
return self._uploaded_by

@uploaded_by.setter
def uploaded_by(self, uploaded_by):
print('Setter Called with Value ', uploaded_by)
self._uploaded_by = uploaded_by

p = FileObject()
p.save()
This outputs:

Setter Called with Value  

I would expect to get None instead

Here is the StackOverflow Question where I started this:
https://stackoverflow.com/questions/59623952/weird-issue-when-using-dataclass-and-property-together

--
components: Library (Lib)
messages: 359528
nosy: Michael Robellard
priority: normal
severity: normal
status: open
title: dataclass defaults and property don't work together
type: behavior
versions: Python 3.7, 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



[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

So it just took 9 years to fix this old bug :-)

--

___
Python tracker 

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



[issue38871] lib2to3 generates invalid code with filter and ternary operator

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Zoran Simic to the bug report, and thanks Dong-hee Na for fixing it.

It's fixed in the master branch and backports to 3.7 and 3.8 will land as soon 
as the CI tests pass.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

___
Python tracker 

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



[issue38871] lib2to3 generates invalid code with filter and ternary operator

2020-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17310
pull_request: https://github.com/python/cpython/pull/17900

___
Python tracker 

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



[issue38871] lib2to3 generates invalid code with filter and ternary operator

2020-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17309
pull_request: https://github.com/python/cpython/pull/17899

___
Python tracker 

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



[issue38871] lib2to3 generates invalid code with filter and ternary operator

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b821173b5458d137c8d5edb6e9b4997aac800a38 by Victor Stinner 
(Dong-hee Na) in branch 'master':
bpo-38871: Fix lib2to3 for filter-based statements that contain lambda 
(GH-17780)
https://github.com/python/cpython/commit/b821173b5458d137c8d5edb6e9b4997aac800a38


--
nosy: +vstinner

___
Python tracker 

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



[issue38615] imaplib has no timeout setting

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Jairo Llopis for the feature request and thanks Dong-hee Na for actually 
implementing it!

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



[issue38615] imaplib has no timeout setting

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 13a7ee8d62dafe7d2291708312fa2a86e171c7fa by Victor Stinner 
(Dong-hee Na) in branch 'master':
bpo-38615: Add timeout parameter for IMAP4 and IMAP4_SSL constructor (GH-17203)
https://github.com/python/cpython/commit/13a7ee8d62dafe7d2291708312fa2a86e171c7fa


--
nosy: +vstinner

___
Python tracker 

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



[issue39198] Lock may not be released in Logger.isEnabledFor

2020-01-07 Thread Vinay Sajip


Change by Vinay Sajip :


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



[issue39198] Lock may not be released in Logger.isEnabledFor

2020-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset d46dec981abdefba56336521c7587c8554bb1b9d by Vinay Sajip (Miss 
Islington (bot)) in branch '3.7':
bpo-39198: Ensure logging global lock is released on exception in isEnabledFor 
(GH-17689) (GH-17898)
https://github.com/python/cpython/commit/d46dec981abdefba56336521c7587c8554bb1b9d


--

___
Python tracker 

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



[issue39198] Lock may not be released in Logger.isEnabledFor

2020-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset bff48c6734f936257b0cfae58dbea67d43e3b245 by Vinay Sajip (Miss 
Islington (bot)) in branch '3.8':
bpo-39198: Ensure logging global lock is released on exception in isEnabledFor 
(GH-17689) (GH-17897)
https://github.com/python/cpython/commit/bff48c6734f936257b0cfae58dbea67d43e3b245


--

___
Python tracker 

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



[issue39198] Lock may not be released in Logger.isEnabledFor

2020-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17308
pull_request: https://github.com/python/cpython/pull/17898

___
Python tracker 

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



[issue39198] Lock may not be released in Logger.isEnabledFor

2020-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17307
pull_request: https://github.com/python/cpython/pull/17897

___
Python tracker 

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



[issue39198] Lock may not be released in Logger.isEnabledFor

2020-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 950c6795aa0ffa85e103a13e7a04e08cb34c66ad by Vinay Sajip (Derek 
Brown) in branch 'master':
bpo-39198: Ensure logging global lock is released on exception in isEnabledFor 
(GH-17689)
https://github.com/python/cpython/commit/950c6795aa0ffa85e103a13e7a04e08cb34c66ad


--

___
Python tracker 

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



[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2020-01-07 Thread Christian Heimes

Christian Heimes  added the comment:

PS: The first entry of the result is a decomposed string, too:

>>> r = [x.lower() for x in 'İ']
>>> hex(ord(r[0][0]))
'0x69'
>>> hex(ord(r[0][1]))
'0x307'

--
nosy: +christian.heimes

___
Python tracker 

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



[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2020-01-07 Thread STINNER Victor

STINNER Victor  added the comment:

> I would expect that the results would be the same in both cases.

It's not. Read again my previous comment.

>>> ["U+%04x" % ord(ch) for ch in "İ".lower()]
['U+0069', 'U+0307']

--

___
Python tracker 

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



[issue39236] [venv] Adding a .gitignore file to virtual environments

2020-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:

I'm -0.5 on this. Beginners will probably shoot themselves in the foot multiple 
ways using git (or any DVCS), in terms of checking things in they didn't mean 
to (e.g. build artifacts which are not in the venv). As they can easily undo 
this, I don't think we need to do this.

--

___
Python tracker 

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



[issue39226] venv does not include pythonXX.lib

2020-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:

The python38.lib file isn't present in any venv, whether created by virtualenv 
or "python -m venv". I believe the mod_wsgi build process may not cater for 
building in a venv on Windows.

When created with "python -m venv", a venv contains the file pyvenv.cfg with 
contents like this:

home = C:\Users\Vinay\AppData\Local\Programs\Python\Python38
include-system-site-packages = false
version = 3.8.1

and the location of python38.lib on this system is given by the libs directory 
relative to the home value in the above snippet.

I don't think this is a venv bug so I will probably close this issue soon, 
unless you provide more evidence of an actual problem in the venv package.

--

___
Python tracker 

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



[issue37194] Move new vector private declarations to the internal C API

2020-01-07 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +17306
pull_request: https://github.com/python/cpython/pull/17896

___
Python tracker 

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



[issue39232] asyncio crashes when tearing down the proactor event loop

2020-01-07 Thread Michael Hall


Michael Hall  added the comment:

I don't know if it would be feasible to add this to asyncio, but having a way 
to mark a resource as needing to be deterministically cleaned up at loop close 
could probably solve this as well as the underlying reasons why the transports 
are leaning on __del__ behavior which is an implementation detail (differing 
on, for example, pypy) and probably improve the overall usefulness of 
asyncio.run as well.

An addition like that probably requires more discussion than fixing this crash 
though.

--

___
Python tracker 

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



[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2020-01-07 Thread Philippe Ombredanne

Philippe Ombredanne  added the comment:

There is a weird thing though (using Python 3.6.8):

>>> [x.lower() for x in 'İ']
['i̇']
>>> [x for x in 'İ'.lower()]
['i', '̇']

I would expect that the results would be the same in both cases. (And this is a 
source of a bug for some code of mine)

--
nosy: +pombredanne

___
Python tracker 

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-07 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-07 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 4112a3da2e01ecc19e9f54b8ac7b383b6f5e85c8 by Andrew Svetlov in 
branch '3.8':
[3.8] bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863) (#17894)
https://github.com/python/cpython/commit/4112a3da2e01ecc19e9f54b8ac7b383b6f5e85c8


--

___
Python tracker 

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



[issue39246] shutil.rmtree is inefficient because of using os.scandir instead of os.walk

2020-01-07 Thread Felipe A. Hernandez


New submission from Felipe A. Hernandez :

os.rmtree has fd-based symlink replacement protection when iterating with 
scandir (after bpo-28564).

This logic could be greatly simplified simply by os.fwalk in supported 
platforms, which already implements a similar (maybe safer) protection.

--
components: Library (Lib)
messages: 359512
nosy: Felipe A. Hernandez
priority: normal
severity: normal
status: open
title: shutil.rmtree is inefficient because of using os.scandir instead of 
os.walk
versions: Python 3.5, Python 3.6, Python 3.7, 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



[issue39239] select.epoll.unregister(fd) should not ignore EBADF

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5b23f7618d434f3000bde482233c8642a6eb2c67 by Victor Stinner in 
branch 'master':
bpo-39239: epoll.unregister() no longer ignores EBADF (GH-17882)
https://github.com/python/cpython/commit/5b23f7618d434f3000bde482233c8642a6eb2c67


--

___
Python tracker 

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



[issue38209] Simplify dataclasses.InitVar by using __class_getitem__()

2020-01-07 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-07 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +17305
pull_request: https://github.com/python/cpython/pull/17895

___
Python tracker 

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-07 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +17304
pull_request: https://github.com/python/cpython/pull/17894

___
Python tracker 

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



[issue39161] Py_NewInterpreter docs need updating for multi-phase initialization

2020-01-07 Thread Petr Viktorin


Petr Viktorin  added the comment:

Thanks for the report. I'll draft something better.

--

___
Python tracker 

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 10ac0cded26d91c3468e5e5a87cecad7fc0bcebd by Miss Islington (bot) 
(Andrew Svetlov) in branch 'master':
bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863)
https://github.com/python/cpython/commit/10ac0cded26d91c3468e5e5a87cecad7fc0bcebd


--
nosy: +miss-islington

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-01-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>  We might need to tweak the documentation @pablogsal, 

Maybe we can say that is 'as close as possible' if you pass an arbitrary AST 
object (if only happens with Constants we could documment exactly that). Let me 
think about this and I will make PR updating the docs.

--

___
Python tracker 

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



[issue39245] Public API for Vectorcall (PEP 590)

2020-01-07 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue39245] Public API for Vectorcall (PEP 590)

2020-01-07 Thread Petr Viktorin


Change by Petr Viktorin :


--
components: +C API
versions: +Python 3.9

___
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

2020-01-07 Thread Petr Viktorin


Petr Viktorin  added the comment:

issue39245 tracks making the API public in Python 3.9.

--

___
Python tracker 

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



[issue39245] Public API for Vectorcall (PEP 590)

2020-01-07 Thread Petr Viktorin


New submission from Petr Viktorin :

As per PEP 590, in Python 3.9 the Vectorcall API will be public, i.e. without 
leading underscores.

--
messages: 359506
nosy: petr.viktorin
priority: normal
severity: normal
status: open
title: Public API for Vectorcall (PEP 590)

___
Python tracker 

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



[issue18969] test suite: enable faulthandler timeout in assert_python

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

I modified regrtest to use process groups in bpo-38502. It doesn't solve 
exactly this issue, but it does fix the overall problem of leaking running 
processes when a test fails for various reasons. For example, when using 
regrtest in multiprocessing (-jN) mode), if a test times out, child processes 
of this test will now be killed.

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



[issue38502] regrtest: use process groups

2020-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

The test_pty has been fixed.

regrtest now calls setsid() when using multiprocessing (-jN), but only in the 
main branch. It's a nice feature, but I'm not comfortable about backporting it 
yet. Maybe if tests become too unstable on other branches, we may backport the 
feature to 3.7 and 3.8.

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-01-07 Thread Stefan Holek


New submission from Stefan Holek :

In Python 3.8 the default start method has changed from fork to spawn on macOS.
https://docs.python.org/3/whatsnew/3.8.html#multiprocessing

get_all_start_methods() says: "Returns a list of the supported start methods, 
the first of which is the default."
https://docs.python.org/3/library/multiprocessing.html?highlight=finalize#multiprocessing.get_all_start_methods

However, it appears to still return fork as default:

  Python 3.8.1 (default, Dec 22 2019, 03:45:23) 
  [Clang 10.0.1 (clang-1001.0.46.4)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import multiprocessing
  >>> multiprocessing.get_all_start_methods()
  ['fork', 'spawn', 'forkserver']
  >>> 

Thank you!

--
components: Library (Lib), macOS
messages: 359503
nosy: ned.deily, ronaldoussoren, stefanholek
priority: normal
severity: normal
status: open
title: multiprocessing.get_all_start_methods() wrong default on macOS
type: behavior
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



[issue38870] Expose ast.unparse in the ast module

2020-01-07 Thread Batuhan


Batuhan  added the comment:

We might need to tweak the documentation @pablogsal, 

> Unparse an ast.AST object and generate a string with code that would produce 
> an equivalent ast.AST object if parsed back with ast.parse().

If I interpret `equivalent` correctly, this explanation is false under cases 
like constant nodes has an immutable container value (which they can). 

>>> def wrap(expr):
... return ast.Module(body=[ast.Expr(expr)], type_ignores=[])
... 
>>> constant_tuple = wrap(ast.Constant(value=(1, 2, 3), kind=None))
>>> normalpy_tuple = ast.parse("(1, 2, 3)")
>>> ast.unparse(constant_tuple) == ast.unparse(normalpy_tuple)
True
>>> ast.dump(ast.parse(ast.unparse(constant_tuple))) != ast.dump(constant_tuple)
True
>>> ast.dump(ast.parse(ast.unparse(constant_tuple))) == ast.dump(normalpy_tuple)
True

This isn't a bug in the code because there is no way we can generate a string 
that can produce a constant tuple. But this makes the docstring false, at least 
in certain cases.

--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-01-07 Thread Batuhan


Change by Batuhan :


--
pull_requests: +17302
pull_request: https://github.com/python/cpython/pull/17892

___
Python tracker 

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



[issue39243] CDLL __init__ no longer supports name being passed as None when the handle is not None

2020-01-07 Thread David Heffernan


New submission from David Heffernan :

When creating an instance of CDLL (or indeed WinDLL) for a DLL that is already 
loaded, you pass the HMODULE in the handle argument to the constructor.

In older versions of ctypes you could pass None as the name argument when doing 
so. However, the changes in 
https://github.com/python/cpython/commit/2438cdf0e932a341c7613bf4323d06b91ae9f1f1
 now mean that such code fails with a NoneType is not iterable error.

The relevant change is in __init__ for CDLL. The code inside the if _os.name == 
"nt" block sets up mode, but this is pointless is handle is not None. Because 
the mode variable is never used, rightly so because the DLL is already loaded.

The issue could be resolved by changing

if _os.name == "nt":

to

if _os.name == "nt" and handle is not None:


The following program demonstrates the issue:

import ctypes

handle = ctypes.windll.kernel32._handle
print(handle)
lib = ctypes.WinDLL(name=None, handle=handle)
print(lib._handle)

This runs to completion in Python 3.7 and earlier, but fails in Python 3.8 and 
later:

Traceback (most recent call last):
  File "test.py", line 5, in 
lib = ctypes.WinDLL(name=None, handle=handle)
  File "C:\Program Files (x86)\Python\38\lib\ctypes\__init__.py", line 359, in 
__init__
if '/' in name or '\\' in name:
TypeError: argument of type 'NoneType' is not iterable

--
components: Windows, ctypes
messages: 359501
nosy: David Heffernan, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: CDLL __init__ no longer supports name being passed as None when the 
handle is not None
type: behavior
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



[issue38870] Expose ast.unparse in the ast module

2020-01-07 Thread Batuhan


Batuhan  added the comment:

ExtSlice nodes without second value doesn't roundtrip properly

source: x[1:2,]
 Expr(
 value=Subscript(
 value=Name(id='x', ctx=Load()),
-slice=ExtSlice(
-dims=[
-Slice(
-lower=Constant(value=1, kind=None),
-upper=Constant(value=2, kind=None),
-step=None)]),
+slice=Slice(
+lower=Constant(value=1, kind=None),
+upper=Constant(value=2, kind=None),
+step=None),
 ctx=Load()))],
 type_ignores=[])

(I have a fix for unifying both tuple, constant tuple and extslice dims 
traversing)

--

___
Python tracker 

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



[issue39138] import a pycapsule object that's attached on many modules

2020-01-07 Thread Yorkie Liu


Yorkie Liu  added the comment:

Ping Python Team.

--
resolution: remind -> 

___
Python tracker 

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



  1   2   >