[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-25 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue33141] descriptor __set_name__ feature broken for dataclass descriptor fields

2018-03-25 Thread Rick Teachey

New submission from Rick Teachey :

Summary: The descriptor `__set_name__` functionality (introduced in Python 3.6) 
does not seem to be working correctly for `dataclass.Field` objects with a 
default pointing to a descriptor. I have attached a file demonstrating the 
trouble.

Details: If I set a `dataclass` class object field to a `dataclass.field` with 
a descriptor object for the `default` argument, the descriptor's `__set_name__` 
method is not called during initialization. This is unexpected because 
descriptors themselves seem to work pretty much flawlessly, otherwise. 

(Bravo on that by the way! Working descriptors isn't mentioned at all in the 
PEP as a feature but I was very pleased to see them working!!)

System details:
Python 3.7b02
Windows 10
PyCharm Community Edition

btw this is my first ever Python bug report; I hope I did a good job.

--
files: broken__set_name__.py
messages: 314438
nosy: Ricyteach, eric.smith
priority: normal
severity: normal
status: open
title: descriptor __set_name__ feature broken for dataclass descriptor fields
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file47499/broken__set_name__.py

___
Python tracker 

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



[issue23952] cgi: Document the 'maxlen' member of the cgi module

2018-03-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
stage:  -> needs patch
title: Document the 'maxlen' member of the cgi module -> cgi: Document the 
'maxlen' member of the cgi module
versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.2, Python 3.3, Python 
3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue17994] Change necessary in platform.py to support IronPython

2018-03-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder:  -> platform._sys_version does not parse correctly IronPython 2.x 
version

___
Python tracker 

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



[issue33140] shutil.chown on Windows

2018-03-25 Thread Eryk Sun

Eryk Sun  added the comment:

Oops, the SID for BUILTIN\Administrators is S-1-5-32-544. I left out the 
authority ID (5).

--

___
Python tracker 

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



[issue33140] shutil.chown on Windows

2018-03-25 Thread Eryk Sun

New submission from Eryk Sun :

shutil.chown is defined in Windows even though it's only written for Unix and 
only documented as available in Unix. Defining it should be skipped on Windows.

Possibly in 3.8 shutil.chown could be implemented on Windows by calling a new 
os.set_owner function that supports user/group names and SID strings. It could 
copy how icacls.exe allows using SDDL aliases and string SIDs that begin with 
an asterisk (e.g. "*BA" and "*S-1-32-544" for BUILTIN\Administrators). If the 
string starts with an asterisk, get the SID via ConvertStringSidToSid. 
Otherwise get the SID via LookupAccountName. Then to modify the file's user and 
group, try to enable SeRestorePrivilege for the current thread and call 
Set[Named]SecurityInfo.

--
components: IO, Library (Lib), Windows
messages: 314436
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: shutil.chown on Windows
type: behavior
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



[issue33139] Bdb doesn't find instruction in linecache after pdb.set_trace() following os.chdir("/tmp")

2018-03-25 Thread Peter Rounce

New submission from Peter Rounce :

In my view there is a fault in python3 pdb in that if you use pdb.set_trace() 
after using os.chdir() to change the cwd to a directory that does not contain 
the source code being executed, then there is no instruction output on next or 
step. This is shown in the following code where I have added print lines to 
bdb.py file to show the errors.
[The tes program is attached.

python3 testpdb.py
# To output a line of code the canonic function in bdp.py is called 
# to build an absolute path to the source code being executed.

PRINT --> canonic line 32 - canonic = None
PRINT --> canonic line 36 - canonic_abs = 
/home/pythontest/Software/python/3/testpdb.py

# the following  is printed after the call to linecache and shows
# the file accessed, the line number in the code and
# the instruction string returned
PRINT --> filename: /home/pythontest/Software/python/3/testpdb.py - lineno: 
11, line: e=d+5

> /home/pythontest/Software/python/3/testpdb.py(11)()
-> e=d+5
(Pdb) c
# The program is continued and os.chdir("/tmp") is executed.
# Another pdb.set_trace() has been executed, which creates a new Pdb
# class instance, and thus a new Bdb instance, where Bdb.fncache
# used by the canonic function is {}. 
# The canonic function is passed just the filename 'testpdb.py" and
# canonic uses os.path.abs to get a full path. Of course this gives 
# the wrong path to testpdb.py since it just prepends the current
# cwd, thus:-

PRINT --> canonic line 32 - canonic = None
PRINT --> canonic line 36 - canonic_abs = /tmp/testpdb.py

# the call to linecache in format_cache_entry (line 411) doesn't
# find the source code so returns an empty string.

PRINT --> filename: /tmp/testpdb.py - lineno: 15, line: 
> /tmp/testpdb.py(15)()
(Pdb) c

Why canonic is using os.path.abs is not clear to me: it seems to be a
mistake, but it is surprising that it has not been found, if this is the
 case. It is interesting to note that linecache itself, when reading from a 
file with just a filename (and not an absolute path) does not try to guess the 
path with os.path.abs but looks down the python 'sys.path' to find the full 
path to the file. 
This would look like a reasonable solution, but it might be better to extend 
the existing code by checking the full path from the 'os.path.abs' instruction 
with an os.exists call and if this fails doing a search down 'sys.path'.

The modified code in bdb.py for this solution is:-

def getfullpath(self, basename) :
for dirname in sys.path:
try:
fullname = os.path.join(dirname, basename)
except (TypeError, AttributeError):
# Not sufficiently string-like to do anything useful with.
continue
try:
stat = os.stat(fullname)
break
except OSError:
pass
else:
return []
return fullname

def canonic(self, filename):
if filename == "<" + filename[1:-1] + ">":
return filename
canonic = self.fncache.get(filename)
if not canon ic:
canonicabs = canonic = os.path.abspath(filename)
canonic = os.path.normcase(canonic)
# if path does not exists look down sys.path
if not os.path.exists(canonic) :
canonic = self.getfullpath(filename)
canonic = os.path.normcase(canonic)
self.fncache[filename] = canonic
return canonic

--
components: Library (Lib)
files: testpdb.py
messages: 314435
nosy: prounce
priority: normal
severity: normal
status: open
title: Bdb doesn't find instruction in linecache after pdb.set_trace() 
following os.chdir("/tmp")
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file47498/testpdb.py

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-25 Thread Hartmut Goebel

Hartmut Goebel  added the comment:

I can confirm that c6d94c37f4fd863c73fbfbcc918fd23b458b5301 makes the 
PyInstaller test-case, which war the origin of this bug-report, pass.

Thanks for fixing!

--

___
Python tracker 

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



[issue30416] constant folding opens compiler to quadratic time hashing

2018-03-25 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
assignee:  -> benjamin.peterson

___
Python tracker 

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



[issue33138] Improve standard error for uncopyable types

2018-03-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-25 Thread STINNER Victor

STINNER Victor  added the comment:

Would it be possible to not officially allow calling PySys_AddWarnOption() 
before Py_Initialize()? Fix the bug, but don't promote doing that. I just 
suggest to revert:

Doc/c-api/init.rst:

+  * :c:func:`PySys_AddWarnOption`
+  * :c:func:`PySys_AddXOption`
+  * :c:func:`PySys_ResetWarnOptions`

--

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset ee3784594b33c72c3fdca6a71892d22f14045ab6 by Nick Coghlan in 
branch '3.7':
bpo-33053: -m now adds *starting* directory to sys.path (GH-6231) (#6236)
https://github.com/python/cpython/commit/ee3784594b33c72c3fdca6a71892d22f14045ab6


--

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b by Nick Coghlan in 
branch 'master':
bpo-33053: -m now adds *starting* directory to sys.path (GH-6231)
https://github.com/python/cpython/commit/d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b


--

___
Python tracker 

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



[issue25782] CPython hangs on error __context__ set to the error itself

2018-03-25 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I believe the original issue is fixed, the original problem and the one Jack 
followed up with no longer work in modern Python 3.

But there is discussion about possibly doing something better, if anyone is 
interested in doing that I suggest opening a new Enhancement issue and turning 
the patches floating around into PRs for discussion.

i'm closing this as the worst reported behavior has been fixed.

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

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset bc77eff8b96be4f035e665ab35c1d06e22f46491 by Nick Coghlan in 
branch 'master':
bpo-33042: Fix pre-initialization sys module configuration (GH-6157)
https://github.com/python/cpython/commit/bc77eff8b96be4f035e665ab35c1d06e22f46491


--

___
Python tracker 

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



[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Gregory P. Smith

Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

Actually I've started to work on this with #32844, but got no feedback. This 
issue may of course be fixed independently, but the problems with descriptor 
ownership for fds <= 2 will remain unless all ownership problems are fixed at 
once.

--

___
Python tracker 

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



[issue6671] webbrowser doesn't respect xfce default browser

2018-03-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Should this patch be converted to a PR?

--
nosy: +csabella
versions: +Python 3.7, Python 3.8 -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



[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

This bug stems from:

 https://github.com/python/cpython/blob/master/Modules/_posixsubprocess.c#L454

When stdout=fd is passed, that results in c2pwrite=fd.  The stdin/stdout/stderr 
pipe fds are closed when > 2 without checking to see if they are listed in 
pass_fds.

https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1306 maps the 
following:
 stdin -> p2cread
 stdout -> c2pwrite
 stderr -> errwrite

--
assignee:  -> gregory.p.smith
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



[issue33126] Some C buffer protocol APIs not documented

2018-03-25 Thread Stefan Krah

Stefan Krah  added the comment:

And if view->len > len in PyBuffer_FromContiguous(), then
view will contain uninitialized bytes, which is bad.

--

___
Python tracker 

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




[issue33126] Some C buffer protocol APIs not documented

2018-03-25 Thread Stefan Krah

Stefan Krah  added the comment:

Yes, the signatures are weird. In PyBuffer_FromContiguous(), "len" is
the size of "buf" in bytes.

If "buf" contains 6 floats, but "view" only has space for 4, then only
4 are copied into "view".


To avoid that sort of thing, I changed PyBuffer_ToContiguous() to
be more restrictive in 3.3, but kept the len parameter.

In PyBuffer_ToContiguous() it would not matter though if len(buf) > src->len, 
in which case buf would contain uninitialized bytes at
the end.


TBH, I don't think these functions are used very often. :-)

--

___
Python tracker 

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



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I clarified the docs to mention that the inheritable flag is heeded when 
close_fds=False in https://github.com/python/cpython/pull/6240/files

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



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I assumed simon meant "close_fds=False" when he wrote open_fds = True.

Regardless, supplying any pass_fds forces close_fds=True behavior.

File descriptors listed in pass_fds are explicitly set inheritable from within 
the child process prior to calling exec().  See the start of child_exec() 
within Modules/_posixsubprocess.c.

--

___
Python tracker 

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



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Gregory P. Smith

Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue24356] venv documentation incorrect / misleading

2018-03-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.7, Python 3.8 -Python 3.3

___
Python tracker 

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



[issue31869] commentary on ssl.PROTOCOL_TLS

2018-03-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue31869] commentary on ssl.PROTOCOL_TLS

2018-03-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

This was changed for 3.7 and 3.6 in PR1355, but there's no corresponding bpo 
number for that.  Should the relevant changes be backported to 2.7?

--
nosy: +csabella

___
Python tracker 

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



[issue15088] PyGen_NeedsFinalizing is public, but undocumented

2018-03-25 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

What should be done for the PyGen_NeedsFinalizing API?  Does it need to be 
documented or should it be removed since it's no longer used in the code base?

Thanks!

--
nosy: +csabella
versions: +Python 3.7, Python 3.8 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue33023] Unable to copy ssl.SSLContext

2018-03-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

See issue33138.

--

___
Python tracker 

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



[issue33138] Improve standard error for uncopyable types

2018-03-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Currently most extension types are not pickleable and copyable. The default 
error messages is "can't pickle XXX objects". This is confusing in case of 
copying because not all know that copying falls back to the pickle protocol 
(see for example issue33023). The proposed PR changes the default error 
messages to more neutral "cannot serialize 'XXX' object". This or similar error 
messages are already used in some classes (files, sockets, 
compressors/decompressors).

It also removes __getstate__ methods raising an error from non-pickleable 
extension types. They where added when extension types were pickleable by 
default (fixed in issue22995). Now they are not needed.

--
components: Interpreter Core
messages: 314418
nosy: alexandre.vassalotti, christian.heimes, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve standard error for uncopyable types
type: enhancement
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



[issue33129] Add kwarg-only option to dataclass

2018-03-25 Thread Alan Du

Change by Alan  Du :


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

___
Python tracker 

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



[issue23388] datetime.strftime('%s') does not take timezone into account

2018-03-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> add cross-platform support for %s strftime-format code

___
Python tracker 

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



[issue33023] Unable to copy ssl.SSLContext

2018-03-25 Thread Christian Heimes

Christian Heimes  added the comment:

That's the only reason for PR 6099. The change makes it more obvious that SSL 
objects can't be serialized or copied.

--

___
Python tracker 

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



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Martin Panter

Martin Panter  added the comment:

There is no “open_fds” parameter as far as I know. I presume you meant 
heritable descriptors are still closed with close_fds=True (not open_fds=False).

Are you sure about the second part? In my experiments on Linux, unless I use 
“pass_fds” or one of the “stdin” etc parameters, a non-heritable descriptor is 
never passed to the child, no matter what I use for “close_fds”.

Reading through Issue 6559, the intention of “pass_fds” seems to be to list 
extra file descriptors, in addition to 0, 1 and 2 that are normally passed. The 
documentation says descriptors greater than 2 are closed (due to 
close_fds=True), but in reality the “pass_fds” descriptors seem to be always 
left open, even when they are marked non-heritable.

--
nosy: +martin.panter

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

Marking as fixed, since this is now the version likely to go out in 3.7.0b3 - 
if we find further problems with it (beyond the potential enhancement discussed 
above to make local directory usage opt-in), then those can go in a new issue.

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset a9e5d0e9ef27b14e34631d415e727a07d0f63bef by Nick Coghlan in 
branch 'master':
bpo-33053: Remove test_cmd_line_script debugging print (GH-6237)
https://github.com/python/cpython/commit/a9e5d0e9ef27b14e34631d415e727a07d0f63bef


--

___
Python tracker 

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



[issue31823] Opaque default value for close_fds argument in Popen.__init__

2018-03-25 Thread Martin Panter

Martin Panter  added the comment:

The close_fds= in that signature seems fine to me. If you read 
the documentation, it says the default mode depends on the platform, and on 
other parameters. However I think the signature at 

 should not show close_fds=True, because that is not necessarily the default on 
Windows.

It seems the default on Windows was changed to always True in 3.7, making it 
consistent across platforms and other parameters, thanks to Issue 19764. But 
the 3.7 documentation is quirky. “Changed in version 3.2: The default for 
‘close_fds’ was changed from False to what is described above” refers to the 
3.7 default when it was meant to refer to the 3.2–3.6 default.

--
nosy: +martin.panter

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

3.7 CI finished before I logged off for the night, so this is good to go for 
3.7.0b3 now :)

--
priority: release blocker -> normal

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Change by Nick Coghlan :


--
pull_requests: +5974

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

Initial fix has been merged to master, CI runs pending for the backport to 3.7 
and a follow-up master branch PR to remove a debugging print I noticed when 
resolving a test_import conflict in the backport.

I won't get to merging those until some time after work tomorrow (probably 8 
pm'ish in UTC+10), so if anyone wanted to merge them before that, it would 
likely be a good idea :)

--

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Change by Nick Coghlan :


--
pull_requests: +5973

___
Python tracker 

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



[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Martin Panter

Change by Martin Panter :


--
nosy: +martin.panter

___
Python tracker 

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



[issue24565] the f_lineno getter is broken

2018-03-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +5972
stage:  -> patch review

___
Python tracker 

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



[issue24565] the f_lineno getter is broken

2018-03-25 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Added PR 6233.
One of the GitHub bots failed to link this issue with PR 6233. Maybe this is 
related to the fact that connections to bpo are currently failing intermitently 
with the message:

An error occurred during a connection to bugs.python.org. Peer’s certificate 
has an invalid signature. Error code: SEC_ERROR_BAD_SIGNATURE

--

___
Python tracker 

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



[issue24565] the f_lineno getter is broken

2018-03-25 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

A trace function may also be set in extension modules by PyEval_SetTrace() and 
it may not use f->f_trace. This is another reason why f->f_trace cannot be used 
in PyFrame_GetLineNumber() to know when f->f_lineno is valid.

--

___
Python tracker 

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



[issue33137] line traces may be missed on backward jumps when instrumented with dtrace

2018-03-25 Thread Xavier de Gaye

New submission from Xavier de Gaye :

In _PyEval_EvalFrameDefault(), the call to maybe_dtrace_line() sets 
frame->f_lasti to instr_prev and for that reason, in the ensuing call to 
maybe_call_line_trace(), the call_trace() function with PyTrace_LINE is not 
called as it should when a backward jump is not to the first instruction of the 
line.

--
components: Interpreter Core
messages: 314408
nosy: lukasz.langa, serhiy.storchaka, xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: line traces may be missed on backward jumps when instrumented with dtrace
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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

While I've merged an initial fix for this (so it should be working again in 
3.7.0b3), I'm not going to close the issue until folks have had a chance to 
review and comment on the linked list based approach I've taken.

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



[issue33136] Harden ssl module against CVE-2018-8970

2018-03-25 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 2dd885eaa0d427e84892673c83d697bca5427c8b by Christian Heimes 
(Miss Islington (bot)) in branch '3.7':
[3.7] bpo-33136: Harden ssl module against CVE-2018-8970 (GH-6229) (GH-6230)
https://github.com/python/cpython/commit/2dd885eaa0d427e84892673c83d697bca5427c8b


--

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-25 Thread miss-islington

miss-islington  added the comment:


New changeset c6d94c37f4fd863c73fbfbcc918fd23b458b5301 by Miss Islington (bot) 
in branch '3.7':
bpo-33042: Fix pre-initialization sys module configuration (GH-6157)
https://github.com/python/cpython/commit/c6d94c37f4fd863c73fbfbcc918fd23b458b5301


--
nosy: +miss-islington

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

It turned out some tests in CPython's own test suite were implicitly relying on 
the old behaviour where the current working directory automatically ended up on 
sys.path (see the changes to test_bdb and test_doctest in the updated PR).

--

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

PR posted with the change to use an absolute path for the starting working 
directory in the "-m" case.

That PR also includes a change to improve the fidelity of the test suite: back 
when I first wrote test_cmd_line_script, I was mainly focused on testing the 
runpy aspects, and not the sys.path initialisation aspects, so the way the 
tests worked didn't really check the latter properly.

The test updates get rid of the launch script that was previously confusing 
matters, and instead test sys.path[0] initialisation properly (relying on 
`PYTHONPATH` for the zipimport related cases where just changing the working 
directory isn't sufficient).

--

___
Python tracker 

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



[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5971

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Change by Nick Coghlan :


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

___
Python tracker 

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



[issue33136] Harden ssl module against CVE-2018-8970

2018-03-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5969

___
Python tracker 

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



[issue33136] Harden ssl module against CVE-2018-8970

2018-03-25 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset d02ac25ab0879f1a6de6937573bf00a16b7bd22e by Christian Heimes in 
branch 'master':
bpo-33136: Harden ssl module against CVE-2018-8970 (GH-6229)
https://github.com/python/cpython/commit/d02ac25ab0879f1a6de6937573bf00a16b7bd22e


--

___
Python tracker 

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



[issue33136] Harden ssl module against CVE-2018-8970

2018-03-25 Thread Christian Heimes

Change by Christian Heimes :


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

___
Python tracker 

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



[issue33133] Don't return implicit optional types by get_type_hints

2018-03-25 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

OK, let us then keep this issue as a remainder that we need to update the 
runtime behaviour when the static one changes.

--

___
Python tracker 

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



[issue33136] Harden ssl module against CVE-2018-8970

2018-03-25 Thread Christian Heimes

New submission from Christian Heimes :

Since 3.7, the ssl module uses X509_VERIFY_PARAM_set1_host() to put the burden 
of hostname matching on OpenSSL. More specific, it calls 
X509_VERIFY_PARAM_set1_host(param, server_hostname, 0). The namelen=0 parameter 
means that OpenSSL handles server_hostname as a NUL-terminated C string.

LibreSSL 2.7.0 added X509_VERIFY_PARAM_set1_host(), but took the implementation 
from BoringSSL instead of OpenSSL. The BoringSSL implementation doesn't support 
namelen=0. X509_VERIFY_PARAM_set1_host(param, server_hostname, 0) returns 
success but doesn't configure the SSL connection for hostname verification. As 
a result, LibreSSL 2.7.0 doesn't perform any hostname matching. All trusted 
certificates are accepted for just any arbitrary hostname. This misbehavior 
left Python 3.7 beta open to man-in-the-middle attack.

LibreSSL 2.7.1 has fixed the issue. To harden the ssl module against, I'm also 
changing our implementation to use strlen() instead of 0.


https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-8970
https://bugs.chromium.org/p/boringssl/issues/detail?id=30
https://bugs.chromium.org/p/chromium/issues/detail?id=824799 (restricted for 
now)

--
assignee: christian.heimes
components: SSL
messages: 314400
nosy: christian.heimes
priority: high
severity: normal
stage: needs patch
status: open
title: Harden ssl module against CVE-2018-8970
type: security
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue33127] Python 2.7.14 won't build ssl module with Libressl 2.7.0

2018-03-25 Thread Christian Heimes

Christian Heimes  added the comment:

It's unrelated. PyCA Cryptography doesn't support LibreSSL 2.7 yet, see 
https://github.com/pyca/cryptography/pull/4168

--

___
Python tracker 

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



[issue33053] Avoid adding an empty directory to sys.path when running a module with `-m`

2018-03-25 Thread Nick Coghlan

Change by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-03-25 Thread Garvit Khatri

Change by Garvit Khatri :


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

___
Python tracker 

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



[issue33135] Define field prefixes for the various config structs

2018-03-25 Thread Nick Coghlan

New submission from Nick Coghlan :

While working on https://bugs.python.org/issue33042, I found it hard to keep 
track of which kind of config struct a particular piece of code was referencing.

As a particularly relevant example, we currently have 3 different "warnoptions" 
fields: the private-to-main one for reading the command line settings, the 
"wchar_t *" list in the core config, and the "PyObject *" list object in the 
main interpreter config (which is also the one aliased as sys.warnoptions).

What do you think of adopting a convention where:

* the command line fields all gain a "cmd_" prefix
* the core config fields all gain a "c_" prefix
* the interpreter config fields all gain a "py_" prefix

We'd then have "cmd_warnoptions", "c_warnoptions", and "py_warnoptions" as the 
field names, and it would be more self-evident which layer we were working at 
in any particular piece of code.

--
messages: 314398
nosy: eric.snow, ncoghlan, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Define field prefixes for the various config structs
type: enhancement
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue33114] random.sample() behavior is unexpected/unclear from docs

2018-03-25 Thread Tim Peters

Tim Peters  added the comment:

There's nothing in the docs I can see that implies `sample(x, n)` is a prefix 
of what `sample(x, n+1)` would have returned had the latter been called 
instead.  If so, then - as always - it's "at your own risk" when you rely on 
behaviors that haven't been specified.  Since the universe of _possible_ 
behaviors that haven't been specified is immense, I'd rather we didn't even 
start to list all of them ;-)

Seriously, when the docs don't promise something, it's usually a mistake to 
assume they just forgot to mention it.  I'd leave the docs alone in this case.

--
nosy: +tim.peters

___
Python tracker 

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