[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-26 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Is there a way to test this or trigger this code using Python syntax? 

`slice(start, stop, step).indices()` uses slice_indices in 
Objects/sliceobject.c . I checked the function docs 
https://docs.python.org/2.7/c-api/slice.html#c.PySlice_GetIndices and it states 
below

> You probably do not want to use this function. If you want to use slice 
> objects in versions of Python prior to 2.3, you would probably do well to 
> incorporate the source of PySlice_GetIndicesEx(), suitably renamed, in the 
> source of your extension.

I couldn't see it's usage too anywhere and with Python 3 we have all integers 
are implemented as “long” integer objects of arbitrary size and can see only 
PyLong_Check at 
https://github.com/python/cpython/blob/master/Objects/sliceobject.c#L178

Thanks

--

___
Python tracker 

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



[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You need to expose it in the _testcapi module as Python function.

--

___
Python tracker 

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



[issue29036] logging module: Add `full_module_name` to LogRecord details

2018-07-26 Thread Berker Peksag


Change by Berker Peksag :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue28536] Show the qualified name when a call fails

2018-07-26 Thread Berker Peksag


Change by Berker Peksag :


--
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue34231] PYTHONBREAKPOINT is not documented with python --help

2018-07-26 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
assignee: matrixise
nosy: matrixise
priority: normal
severity: normal
status: open
title: PYTHONBREAKPOINT is not documented with python --help
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



[issue34228] Allow PYTHONTRACEMALLOC=0 and -X tracemalloc=0 to disable explicitly tracemalloc

2018-07-26 Thread STINNER Victor


STINNER Victor  added the comment:

I don't think that it's worth it to backport this change. It's really a corner 
case and it's almsot a bugfix. I mostly need it for testing _PyCoreConfig and 
Python initialisation.

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



[issue34231] PYTHONBREAKPOINT is not documented with python --help

2018-07-26 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue34231] PYTHONBREAKPOINT is not documented with python --help

2018-07-26 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

there is no documentation about PYTHONBREAKPOINT when we execute python --help.

--

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8000

___
Python tracker 

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



[issue34232] Python3.7.0 exe installers (32 and 64 bit) failing on Windows7

2018-07-26 Thread Wolfgang Maier


New submission from Wolfgang Maier :

System: Windows7 Enterprise SP1 64-bit
Downloaded the executable installer from python.org (tried both 32- and 64-bit 
-> same error)

Selected the default user-install and got an almost immediate Error message: 
The TARGETDIR variable must be provided when invoking this installer.

Clicking OK reveals 0x80070643 - Fatal error during installation and the 
attached log file.

Rebooting didn't help and I also tried playing with custom installation 
settings, too, but no success so far.

--
components: Installation
messages: 322409
nosy: steve.dower, wolma
priority: normal
severity: normal
status: open
title: Python3.7.0 exe installers (32 and 64 bit) failing on Windows7
versions: Python 3.7

___
Python tracker 

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



[issue34232] Python3.7.0 exe installers (32 and 64 bit) failing on Windows7

2018-07-26 Thread Wolfgang Maier


Change by Wolfgang Maier :


Added file: https://bugs.python.org/file47712/Python 3.7.0 
(64-bit)_20180726120531.log

___
Python tracker 

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



[issue34197] Make csv.Dialect attributes skipinitialspace, doublequote and strict booleans

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 323748ad7446c76972c80dbbf510534dc5c22ae8 by Serhiy Storchaka in 
branch 'master':
bpo-34197: Make _csv.Dialect attributes booleans. (GH-8440)
https://github.com/python/cpython/commit/323748ad7446c76972c80dbbf510534dc5c22ae8


--

___
Python tracker 

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



[issue20260] Argument Clinic: add unsigned integers converters

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7cb7bcff20a386bba59cbc51e2419542de358bd2 by Serhiy Storchaka in 
branch 'master':
bpo-20260: Implement non-bitwise unsigned int converters for Argument Clinic. 
(GH-8434)
https://github.com/python/cpython/commit/7cb7bcff20a386bba59cbc51e2419542de358bd2


--

___
Python tracker 

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



[issue34201] Make ndarray.readonly a bool

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e0d67f17ccb4645ff88c9a018679b8a5b4fe0a7e by Serhiy Storchaka in 
branch 'master':
bpo-34201: Make ndarray.readonly a bool and use stricter tests in test_buffer. 
(GH-8414)
https://github.com/python/cpython/commit/e0d67f17ccb4645ff88c9a018679b8a5b4fe0a7e


--

___
Python tracker 

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



[issue34233] subprocess.check_output goes to infinte loop

2018-07-26 Thread sanjay patel


New submission from sanjay patel :

Below snipped goes to infinite loop when running through windows command prompt 
but works in python IDLE

import subprocess
subprocess.check_output('cmd.exe dir', stderr=subprocess.STDOUT)

save as:test.py
in windows cmd use command: python test.py
then it goes to infine loop but the same program works in Python IDLE.

--
components: Library (Lib)
messages: 322413
nosy: sanjay patel
priority: normal
severity: normal
status: open
title: subprocess.check_output goes to infinte loop
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



[issue34225] distutils._msvccompiler should trim INCLUDE/LIB directories

2018-07-26 Thread Steve Dower


Steve Dower  added the comment:


New changeset 5473f061f518aef5367a535999a407305fb12aff by Steve Dower in branch 
'master':
bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash. 
(GH-8464)
https://github.com/python/cpython/commit/5473f061f518aef5367a535999a407305fb12aff


--

___
Python tracker 

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



[issue34201] Make ndarray.readonly a bool

2018-07-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34225] distutils._msvccompiler should trim INCLUDE/LIB directories

2018-07-26 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +8001

___
Python tracker 

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



[issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7

2018-07-26 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR adds two private helpers

#define _PyAnyInt_Check(op) (PyInt_Check(op) || PyLong_Check(op))
#define _PyAnyInt_CheckExact(op) (PyInt_CheckExact(op) || PyLong_CheckExact(op))

and make it used it in the code. This may help to avoid bugs like issue34229.

--
components: Interpreter Core
messages: 322415
nosy: benjamin.peterson, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7
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



[issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7

2018-07-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34233] subprocess.check_output goes to infinte loop

2018-07-26 Thread Eryk Sun


Eryk Sun  added the comment:

`cmd.exe dir` ignores the unrecognized `dir` argument and runs the interactive 
shell. The shell is waiting for input on stdin. You can type "exit" and press 
enter to return to Python.  

When you run this from IDLE (i.e. via pythonw.exe), there's no StandardInput 
handle to inherit, so subprocess executes cmd.exe with its stdin set to a 
closed pipe. (I don't know why a closed pipe is used. I think "NUL" would be 
better.) The shell exits immediately because ReadFile fails with 
ERROR_BROKEN_PIPE.

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue34234] Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Most changes are made automatically by the Coccinelle 
(http://coccinelle.lip6.fr) script.

spatch --sp-file anyint.cocci --dir . --in-place

--
Added file: https://bugs.python.org/file47713/anyint.cocci

___
Python tracker 

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



[issue20260] Argument Clinic: add unsigned integers converters

2018-07-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34197] Make csv.Dialect attributes skipinitialspace, doublequote and strict booleans

2018-07-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue33837] Closing asyncio.Server on asyncio.ProactorEventLoop causes all active servers to stop listening

2018-07-26 Thread Anton Patrushev


Anton Patrushev  added the comment:

This issue was fixed in:
git319c0345cdd8fddb49d235462e71883f1dd51b99

--
nosy: +apatrushev

___
Python tracker 

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



[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-26 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
keywords: +patch
pull_requests: +8003
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



[issue34235] PyArg_ParseTupleAndKeywords: support required keyword arguments

2018-07-26 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

In Python the function can have 4 kinds of parameters:

def f(a, b=1, *, c, d=2):

1. a is a required positional-or-keyword parameter.
2. b is an optional positional-or-keyword parameter.
3. c is a required keyword-only parameter.
4. d is an optional keyword-only parameter.

But PyArg_ParseTupleAndKeywords() supports only 3 of them. Keyword-only 
parameters can only be optional.

PyArg_ParseTupleAndKeywords(args, kwds, "O|O$O", kwlist, &a, &b, &d)

This makes impossible using PyArg_ParseTupleAndKeywords() for haslib.scrypt(). 
Currently it parses all keyword-only arguments as optional, and checks that 
they are specified specially, but this does not allow to use the full power of 
the PyArg_Parse* API.

--
assignee: serhiy.storchaka
components: Interpreter Core
messages: 322419
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: PyArg_ParseTupleAndKeywords: support required keyword arguments
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



[issue34201] Make ndarray.readonly a bool

2018-07-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8004

___
Python tracker 

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



[issue34231] PYTHONBREAKPOINT is not documented with python --help

2018-07-26 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

just updated the python man page

--

___
Python tracker 

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



[issue34231] PYTHONBREAKPOINT is not documented with python --help

2018-07-26 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
components: +Documentation

___
Python tracker 

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



[issue32083] sqlite3 Cursor.description can't return column types

2018-07-26 Thread Zackery Spytz


Zackery Spytz  added the comment:

This seems to be a duplicate of #11691.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue31830] asyncio.create_subprocess_exec doesn't capture all stdout output

2018-07-26 Thread Anton Patrushev


New submission from Anton Patrushev :

The issue is invalid. I just added the following lines to the end of your main:
```
line = await asyncio.wait_for(process.stderr.readline(), 10)
print(line)
```

and got additional info:
```
b'/bin/bash: echo local: command not found\n'
```

So the problem is not in asyncio.

--
nosy: +apatrushev

___
Python tracker 

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



[issue34236] Test6012 in test_capi is not run as part of make test

2018-07-26 Thread Karthikeyan Singaravelan

New submission from Karthikeyan Singaravelan :

Test6012 is not run as part of make test since it's not added to 
support.run_unittest at the end of the file. Hence running the test as a single 
file causes error. It seems argparsing related test which is a part of 
_testcapi.module.c in Python 3 branch was not cleanly backported and I tried 
backporting it but it requires PyUnicode_FSConverter which I think is Python 3 
only. Since the test was not running during make test there was no error about 
this during backporting during merge.

Relevant backport commit : ef19fd200d0768919f1658466f8b6080b191fba0

# No argparsing defined in _testcapimodule.c

➜  cpython git:(1c8f655) grep -inr argparsing *
Lib/test/test_capi.py:108:
self.assertEqual(_testcapi.argparsing("Hello", "World"), 1)
➜  cpython git:(1c8f655) grep -inr PyUnicode_FSConverter *

# Test case failure

➜  cpython git:(1c8f655) ./python -m unittest -v test.test_capi
test_buildvalue_N (test.test_capi.CAPITest) ... ok
test_bad_use (test.test_capi.SkipitemTest) ... ok
test_parse_tuple_and_keywords (test.test_capi.SkipitemTest) ... ok
test_skipitem (test.test_capi.SkipitemTest) ... ok
test_skipitem_with_suffix (test.test_capi.SkipitemTest) ... ok
test (test.test_capi.Test6012) ... ERROR
test_pendingcalls_non_threaded (test.test_capi.TestPendingCalls) ... ok
test_pendingcalls_threaded (test.test_capi.TestPendingCalls) ... ok
test_thread_state (test.test_capi.TestThreadState) ... ok

==
ERROR: test (test.test_capi.Test6012)
--
Traceback (most recent call last):
  File "/home/cpython/Lib/test/test_capi.py", line 108, in test
self.assertEqual(_testcapi.argparsing("Hello", "World"), 1)
AttributeError: 'module' object has no attribute 'argparsing'

--
Ran 9 tests in 2.753s

FAILED (errors=1)

# Test passes because Test6012 is not added to support.run_unittest

➜  cpython git:(1c8f655) ./python Lib/test/test_capi.py
internal test_L_code
internal test_broken_memoryview
internal test_buildvalue_N
internal test_capsule
internal test_config
internal test_datetime_capi
internal test_dict_iteration
internal test_empty_argparse
internal test_from_contiguous
internal test_k_code
internal test_lazy_hash_inheritance
internal test_list_api
internal test_long_and_overflow
internal test_long_api
internal test_long_long_and_overflow
internal test_long_numbits
internal test_longlong_api
internal test_null_strings
internal test_string_from_format
internal test_to_contiguous
internal test_u_code
internal test_widechar
internal test_with_docstring
test_buildvalue_N (__main__.CAPITest) ... ok
test_pendingcalls_non_threaded (__main__.TestPendingCalls) ... ok
test_pendingcalls_threaded (__main__.TestPendingCalls) ... ok
test_bad_use (__main__.SkipitemTest) ... ok
test_parse_tuple_and_keywords (__main__.SkipitemTest) ... ok
test_skipitem (__main__.SkipitemTest) ... ok
test_skipitem_with_suffix (__main__.SkipitemTest) ... ok
test_thread_state (__main__.TestThreadState) ... ok

--
Ran 8 tests in 2.741s

OK

Adding serhiy.storchaka who did the relevant backport.


Thanks

--
components: Build
messages: 322423
nosy: serhiy.storchaka, xtreak
priority: normal
severity: normal
status: open
title: Test6012 in test_capi is not run as part of make test
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



[issue32663] SMTPUTF8SimTests are not actually being run

2018-07-26 Thread R. David Murray


R. David Murray  added the comment:


New changeset 89352b08aad447d046551fa0cd374becd7941c91 by R. David Murray (Miss 
Islington (bot)) in branch '3.7':
bpo-32663 Make SMTPUTF8SimTests run (GH-5314) (#8471)
https://github.com/python/cpython/commit/89352b08aad447d046551fa0cd374becd7941c91


--

___
Python tracker 

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



[issue32663] SMTPUTF8SimTests are not actually being run

2018-07-26 Thread R. David Murray


R. David Murray  added the comment:


New changeset cecbe0ade87360cd37cc1389fe33dd92f2cf52ba by R. David Murray (Miss 
Islington (bot)) in branch '3.6':
bpo-32663 Make SMTPUTF8SimTests run (GH-5314) (#8470)
https://github.com/python/cpython/commit/cecbe0ade87360cd37cc1389fe33dd92f2cf52ba


--

___
Python tracker 

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



[issue32663] SMTPUTF8SimTests are not actually being run

2018-07-26 Thread R. David Murray


R. David Murray  added the comment:

Thanks, Chason.

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d145775b451bbae549391eb49ed612fb3b03bde1 by Victor Stinner in 
branch 'master':
bpo-34170: Cleanup pymain_read_conf() (GH-8476)
https://github.com/python/cpython/commit/d145775b451bbae549391eb49ed612fb3b03bde1


--

___
Python tracker 

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



[issue32814] smtplib.send_message mishandles 8BITMIME RFC 6152

2018-07-26 Thread R. David Murray


R. David Murray  added the comment:

OK, the #32663 test fix I mentioned in the review is merged.

--
versions:  -Python 3.5

___
Python tracker 

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



[issue33678] selector_events.BaseSelectorEventLoop.sock_connect should preserve socket type

2018-07-26 Thread Anton Patrushev


Anton Patrushev  added the comment:

I created small script showing the error.

--
nosy: +apatrushev
versions: +Python 3.7
Added file: https://bugs.python.org/file47714/test.py

___
Python tracker 

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



[issue34237] faq/design: PEP 572 adds assignment expressions

2018-07-26 Thread Jonathan Fine


New submission from Jonathan Fine :

The title says it all.
faq/design: PEP 572 adds assignment expressions

https://docs.python.org/3.8/faq/design.html#why-can-t-i-use-an-assignment-in-an-expression
[Can't use] this C idiom:
while (line = readline(f)) {
// do something with line
}

https://www.python.org/dev/peps/pep-0572/
while chunk := file.read(8192):
   process(chunk)

--
assignee: docs@python
components: Documentation
messages: 322430
nosy: docs@python, jfine2358
priority: normal
severity: normal
status: open
title: faq/design: PEP 572 adds assignment expressions
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



[issue29750] smtplib doesn't handle unicode passwords

2018-07-26 Thread Tal Einat


Tal Einat  added the comment:

Never mind, I won't have time for this any time soon, better if someone else 
can do it.

--

___
Python tracker 

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



[issue32083] sqlite3 Cursor.description can't return column types

2018-07-26 Thread Berker Peksag


Berker Peksag  added the comment:

Good catch, Zackery, thanks! This is indeed a duplicate of issue 11691.

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> sqlite3 Cursor.description doesn't set type_code

___
Python tracker 

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



[issue34206] Move and clarify Py_Main documentation

2018-07-26 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue34206] Move and clarify Py_Main documentation

2018-07-26 Thread Eric Snow


Change by Eric Snow :


--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't want to make any guarantees beyond what the doc patch says.

Commutativity guarantees are difficult to deliver without exact summation. A 
switchover to C's hypot() creates an external dependency such that we can't 
make any more guarantees than were given to us (which is nothing).  Also, 
algorithmic switchovers risk impairing monotonicity.  The Inf/NaN rules already 
existed before this patch and I believe that Mark elected to not document them 
on a function by function basis.  Another reason not to make guarantees is that 
this is a "mostly good-enough patch" and I expect that either Mark or Tim will 
someday improve it with a "single-rounding dot product".  My aim is to make it 
good before any effort is given to making it perfect.  In the meantime, it 
makes little sense to guarantee implementation details.

--

___
Python tracker 

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



[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Commutativity guarantees can be delivered by sorting arguments before 
summation. In any case the sorting is needed for more accurate summation (from 
smaller to larger).

--

___
Python tracker 

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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-07-26 Thread Anthony Sottile


Change by Anthony Sottile :


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

___
Python tracker 

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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-07-26 Thread Anthony Sottile


Anthony Sottile  added the comment:

I was able to reproduce both the `PermissionError` and the `FileNotFoundError` 
under these circumstances:

$ docker run --user 123:123 -ti python python
Python 3.7.0 (default, Jul 17 2018, 11:04:33) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
Error in atexit._run_exitfuncs:
PermissionError: [Errno 13] Permission denied


$ docker run --user nobody -ti python python
Python 3.7.0 (default, Jul 17 2018, 11:04:33) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
Error in atexit._run_exitfuncs:
FileNotFoundError: [Errno 2] No such file or directory


In the former, the home directory is `/` (not writable).  In the latter, the 
homedir is `/nonexistent`, which, well, doesn't exist.

My patch addresses both of these errors.

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8006

___
Python tracker 

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



[issue34225] distutils._msvccompiler should trim INCLUDE/LIB directories

2018-07-26 Thread Steve Dower


Change by Steve Dower :


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



[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2bea7716093012319b5e6a4260fe802b15031f21 by Serhiy Storchaka 
(Xtreak) in branch '2.7':
bpo-34229: Check start and stop of slice object to be long when they are not 
int in PySlice_GetIndices (GH-8480)
https://github.com/python/cpython/commit/2bea7716093012319b5e6a4260fe802b15031f21


--

___
Python tracker 

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



[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your PR Karthikeyan!

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



[issue32814] smtplib.send_message mishandles 8BITMIME RFC 6152

2018-07-26 Thread Segev Finer


Segev Finer  added the comment:

> OK, the #32663 test fix I mentioned in the review is merged.

Yeah. I already merged it in.

--

___
Python tracker 

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



[issue34238] When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't work

2018-07-26 Thread Jason

New submission from Jason :

Description: When BROWSER is set, webbrowser.get fails because 
register_standard_browsers throws an error.

Work around: You can still use `webbroswer._browsers[key][1].open(url)` to open 
a browser. 


Operating system: macOS High Sierra v10.13.6


Reproduction 1:

```
➜ BROWSER=lynx python3

Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.get()
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py",
 line 42, in get
register_standard_browsers()
  File 
"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py",
 line 567, in register_standard_browsers
cmd = _synthesize(cmdline, -1)
  File 
"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py",
 line 116, in _synthesize
register(browser, None, controller, update_tryorder)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given
```


Reproduction 2:

```
➜  BROWSER=lynx python3

Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.register_standard_browsers()
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py",
 line 567, in register_standard_browsers
cmd = _synthesize(cmdline, -1)
  File 
"/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/webbrowser.py",
 line 116, in _synthesize
register(browser, None, controller, update_tryorder)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given
>>> webbrowser.lynx
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module 'webbrowser' has no attribute 'lynx'
>>> webbrowser._browsers
{'macosx': [None, ], 
'chrome': [None, ], 
'firefox': [None, ], 
'safari': [None, ], 'lynx': 
[None, ]}
>>> webbrowser._browsers['lynx'].open('http://google.com')
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'list' object has no attribute 'open'
>>> webbrowser._browsers['lynx'][1].open('http://google.com') # This works
True
```

--
components: macOS
messages: 322439
nosy: ned.deily, ograycode, ronaldoussoren
priority: normal
severity: normal
status: open
title: When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't 
work
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue34170] Py_Initialize(): computing path configuration must not have side effect (PEP 432)

2018-07-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 56b29b6d6fa3eb32bb1533ee3f21b1e7135648a0 by Victor Stinner in 
branch 'master':
bpo-34170, test_embed: write Py_Initialize() tests (GH-8484)
https://github.com/python/cpython/commit/56b29b6d6fa3eb32bb1533ee3f21b1e7135648a0


--

___
Python tracker 

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



[issue34238] When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't work

2018-07-26 Thread Jason


Change by Jason :


--
type: crash -> 

___
Python tracker 

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



[issue34239] Convert test_bz2 to use tempfile

2018-07-26 Thread Tim Golden


New submission from Tim Golden :

test_bz2 currently uses the test.support.TESTFN functionality which creates a 
temporary file local to the test directory named around the pid. 

This can give rise to race conditions where tests are competing with each other 
to delete and recreate the file.

--
assignee: tim.golden
messages: 322441
nosy: tim.golden
priority: normal
severity: normal
status: open
title: Convert test_bz2 to use tempfile
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



[issue32814] smtplib.send_message mishandles 8BITMIME RFC 6152

2018-07-26 Thread Segev Finer


Segev Finer  added the comment:

Merged into the PR that is.

--

___
Python tracker 

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



[issue34239] Convert test_bz2 to use tempfile

2018-07-26 Thread Tim Golden


Change by Tim Golden :


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

___
Python tracker 

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



[issue34238] When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't work

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it is fixed in issue31014.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34240] Convert test_mmap to use tempfile

2018-07-26 Thread Tim Golden


New submission from Tim Golden :

test_mmap currently uses the test.support.TESTFN functionality which creates a 
temporary file local to the test directory named around the pid. 

This can give rise to race conditions where tests are competing with each other 
to delete and recreate the file.

--
assignee: tim.golden
messages: 322444
nosy: tim.golden
priority: normal
severity: normal
status: open
title: Convert test_mmap to use tempfile
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



[issue34241] Segfault while Django template rendering

2018-07-26 Thread vhelke

New submission from vhelke :

I have found a segfault in Django 2.0 while rendering a template.

Detailed info here, and instructions of how to reproduce the fault: 
​https://github.com/vhelke/django-cas-crash

***

Here are the traces I was able to collect.

$ gdb python




Program received signal SIGSEGV, Segmentation fault.
0x7711f547 in kill () at ../sysdeps/unix/syscall-template.S:81
81T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)




(gdb) py-bt
Traceback (most recent call first):
  
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/utils/autoreload.py",
 line 303, in python_reloader
os.kill(os.getpid(), -exit_code)
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/utils/autoreload.py",
 line 317, in main
python_reloader(wrapped_main_func, args, kwargs)
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
 line 105, in run
autoreload.main(self.inner_run, None, options)
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
 line 98, in handle
self.run(**options)
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/base.py",
 line 335, in execute
output = self.handle(*args, **options)
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
 line 61, in execute
super().execute(*args, **options)
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/base.py",
 line 288, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/__init__.py",
 line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/__init__.py",
 line 371, in execute_from_command_line
utility.execute()
  File "manage.py", line 15, in 
execute_from_command_line(sys.argv)






(gdb) bt
#0  0x7711f547 in kill () at ../sysdeps/unix/syscall-template.S:81
#1  0x0054c420 in os_kill_impl (module=, signal=, pid=) at 
./Modules/posixmodule.c:6534
#2  os_kill (module=module@entry=, 
args=args@entry=0x7fffea24d5b0, nargs=) at 
./Modules/clinic/posixmodule.c.h:2624
#3  0x00439dcd in _PyMethodDef_RawFastCallKeywords (kwnames=0x0, 
nargs=0, args=0x7fffea24d5b0, self=, 
method=0x8c8aa0 ) at Objects/call.c:651
#4  _PyCFunction_FastCallKeywords (func=, args=args@entry=0x7fffea24d5b0, nargs=nargs@entry=2, 
kwnames=kwnames@entry=0x0) at Objects/call.c:730
#5  0x00428f1c in call_function (kwnames=0x0, oparg=2, 
pp_stack=) at Python/ceval.c:4547
#6  _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3086
#7  0x0041fc18 in function_code_fastcall (co=, 
args=, nargs=3, globals=) at Objects/call.c:283
#8  0x004392f6 in _PyFunction_FastCallKeywords (func=, 
stack=, nargs=, kwnames=) at 
Objects/call.c:415
#9  0x004284bc in call_function (kwnames=0x0, oparg=, 
pp_stack=) at Python/ceval.c:4586
#10 _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3117
#11 0x004ec058 in PyEval_EvalFrameEx (throwflag=0,
f=Frame 0x7fffea3ecaf8, for file 
/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/utils/autoreload.py,
 line 317, in main (main_func=, args=(), 
kwargs={'verbosity': 1, 'settings': None, 'pythonpath': None, 'traceback': 
False, 'no_color': False, 'addrport': None, 'use_ipv6': False, 'use_threading': 
True, 'use_reloader': True, 'use_static_handler': True, 'insecure_serving': 
False}, wrapped_main_func=)) at 
Python/ceval.c:547
#12 _PyEval_EvalCodeWithName (_co=, 
globals=, locals=locals@entry=0x0, args=, 
argcount=3, kwnames=0x0, kwargs=kwargs@entry=0x7fffeabfa1f0,
kwcount=0, kwstep=kwstep@entry=1, defs=defs@entry=0x7fffefc93160, 
defcount=defcount@entry=2, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, 
name='main', qualname='main') at Python/ceval.c:3923
#13 0x00439228 in _PyFunction_FastCallKeywords (func=, 
stack=, nargs=, kwnames=) at 
Objects/call.c:433
#14 0x00428beb in call_function (kwnames=0x0, oparg=, 
pp_stack=) at Python/ceval.c:4586
#15 _PyEval_EvalFrameDefault (f=, throwflag=) at 
Python/ceval.c:3086
#16 0x004ec058 in PyEval_EvalFrameEx (throwflag=0,
f=Frame 0x7fffeabfa048, for file 
/home/vhelke/Envs/django-cas-crash/lib/python3.7/site-packages/django/core/management/commands/runserver.py,
 line 105, in run (self=, _style_func=, 
ending='\n') at remote 0x7fffeb311438>, 
stderr=, 
_style_func=, ending='\n') at remote 
0x7fffead2cf60>, style=, 
SUCCESS=, WARNING=, NOTICE=, 
SQL_FIELD=, SQL_COLTYPE=, SQL_KEYWORD=, 
SQL_TABLE=, HTTP_INFO=, HTTP_SUCCESS=, 
HTTP_REDIRECT=,
globals=globals@entry={'__name__': 
'django.co

[issue34240] Convert test_mmap to use tempfile

2018-07-26 Thread Tim Golden


Change by Tim Golden :


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

___
Python tracker 

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



[issue32395] asyncio.StreamReader.readuntil is not general enough

2018-07-26 Thread Anton Patrushev


Change by Anton Patrushev :


--
nosy: +socketpair

___
Python tracker 

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



[issue25461] Unclear language (the word ineffective) in the documentation for os.walk

2018-07-26 Thread Jonathan Fine


Change by Jonathan Fine :


--
nosy: +jfine2358

___
Python tracker 

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



[issue34238] When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't work

2018-07-26 Thread Jason

Jason  added the comment:

Serhiy, I believe you are correct. I updated my local python and it passed.

However, I think there might be a bug with the implementation that doesn't
correctly respect the BROWSER preference. If I do:

```
➜  BROWSER=lynx python3

Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.register_standard_browsers()
>>> webbrowser._tryorder
['MacOSX', 'chrome', 'firefox', 'safari', 'lynx', 'lynx']
>>> webbrowser._browsers
{'macosx': [None, ],
'chrome': [None, ],
'firefox': [None, ],
'safari': [None, ],
'lynx': [None, ]}
```
Notice how the webbrowser._tryorder has two 'lynx' items and both of them
are last. If you look at the comment in the code, it says that it should be
prepended to _tryorder because it's the preferred browser. See
https://github.com/python/cpython/blob/56b29b6d6fa3eb32bb1533ee3f21b1e7135648a0/Lib/webbrowser.py#L563

If I change `cmd = _synthesize(cmdline, preferred=False)`, line 566, to
preferred=True then the output is like this:

```
>>> webbrowser._tryorder
['lynx', 'MacOSX', 'chrome', 'firefox', 'safari', 'lynx']
```

Which I believe is closer to being correct based upon the comments in the
code.

Am I wrong about this, and should I open up a new bug report for it?

Thanks.

On Thu, Jul 26, 2018 at 1:49 PM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> I think it is fixed in issue31014.
>
> --
> nosy: +serhiy.storchaka
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue29750] smtplib doesn't handle unicode passwords

2018-07-26 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Hello. I would like to work on this, should the issue be assigned on me or this 
comment is enough?

--
nosy: +Vadim Pushtaev

___
Python tracker 

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



[issue34242] configparser: SectionProxy.get is silent on missing options

2018-07-26 Thread Stig Johan Berggren


New submission from Stig Johan Berggren :

`get()` on a ConfigParser object behaves differently from `get()` on a section. 
The former raises an exception when the key does not exist and no fallback has 
been explicitly set. The latter returns None, with no option to raise an error 
for missing keys. I think this is confusing, and that both classes should have 
the same behaviour. I prefer raising an error, as it makes it easier to find 
errors such as typos in config files.

In addition, the docs state that the "parser-level `get` method
provides a custom, more complex interface, maintained for backwards
compatibility". The SectionProxy `get` method internally uses the parser-level 
`get`, so it seems unlikely that it is only maintained for backwards 
compatibility.

My proposed change is not backwards compatible, as any code that relies on a 
None being returned when a key does not exist would have to make this explicit 
through the fallback argument in `get`.

Here is the current behaviour in the latest build (3.8.0a0):

>>> import configparser
>>> c = configparser.ConfigParser()
>>> c.add_section('spam')
>>> c['spam'].get('eggs') # Returns None
>>> c['spam']['eggs']
Traceback (most recent call last):
  ...
KeyError: 'eggs'
>>> c.get('spam', 'eggs')
Traceback (most recent call last):
  ...
configparser.NoOptionError: No option 'eggs' in section: 'spam'
>>>

--
components: Library (Lib)
messages: 322448
nosy: Stig Johan Berggren
priority: normal
severity: normal
status: open
title: configparser: SectionProxy.get is silent on missing options
type: behavior

___
Python tracker 

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



[issue34242] configparser: SectionProxy.get is silent on missing options

2018-07-26 Thread Stig Johan Berggren


Change by Stig Johan Berggren :


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

___
Python tracker 

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



[issue11594] 2to3 does not preserve line endings

2018-07-26 Thread Slawomir Nowaczyk


Slawomir Nowaczyk  added the comment:

I've just tried 2to3 in 3.7.0, and it still breaks line endings for me...

Seems like one also needs to fix line 517 in refactor.py
  fp = io.open(filename, "w", encoding=encoding, newline='')

--
nosy: +Slawomir Nowaczyk

___
Python tracker 

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



[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2018-07-26 Thread Anton Patrushev


Change by Anton Patrushev :


--
nosy: +apatrushev

___
Python tracker 

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



[issue29750] smtplib doesn't handle unicode passwords

2018-07-26 Thread Tal Einat


Tal Einat  added the comment:

A comment here is all that is needed.

--

___
Python tracker 

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



[issue34239] Convert test_bz2 to use tempfile

2018-07-26 Thread Tim Golden


Tim Golden  added the comment:


New changeset 6a62e1d365934de82ff7c634981b3fbf218b4d5f by Tim Golden in branch 
'master':
bpo-34239: Convert test_bz2 to use tempfile (#8485)
https://github.com/python/cpython/commit/6a62e1d365934de82ff7c634981b3fbf218b4d5f


--

___
Python tracker 

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



[issue34243] pty.spawn: inconsistent interface

2018-07-26 Thread zerx


New submission from zerx :

# spawn(argv, master_read=_read, stdin_read=_read)

With stdin_read function it's possible to customize how one can read from 
stdin, but it makes little sense without stdout counterpart. For example, you 
cannot use a wrapped ssl socket to forward a terminal over secure connection, 
because os.write(STDOUT_FILENO, data) is not suitable for ssl sockets.

The proposal is to add stdout_write argument.

diff --git a/pty.py b/pty.py
index e841f12..ed4a12f 100644
--- a/pty.py
+++ b/pty.py
@@ -126,10 +126,10 @@ def _read(fd):
 """Default read function."""
 return os.read(fd, 1024)
 
-def _copy(master_fd, master_read=_read, stdin_read=_read):
+def _copy(master_fd, master_read=_read, stdin_read=_read, 
stdout_write=_writen):
 """Parent copy loop.
 Copies
-pty master -> standard output   (master_read)
+pty master -> standard output   (master_read, stdout_write)
 standard input -> pty master(stdin_read)"""
 fds = [master_fd, STDIN_FILENO]
 while True:
@@ -139,7 +139,7 @@ def _copy(master_fd, master_read=_read, stdin_read=_read):
 if not data:  # Reached EOF.
 fds.remove(master_fd)
 else:
-os.write(STDOUT_FILENO, data)
+stdout_write(STDOUT_FILENO, data)
 if STDIN_FILENO in rfds:
 data = stdin_read(STDIN_FILENO)
 if not data:
@@ -147,7 +147,7 @@ def _copy(master_fd, master_read=_read, stdin_read=_read):
 else:
 _writen(master_fd, data)
 
-def spawn(argv, master_read=_read, stdin_read=_read):
+def spawn(argv, master_read=_read, stdin_read=_read, stdout_write=_writen):
 """Create a spawned process."""
 if type(argv) == type(''):
 argv = (argv,)
@@ -161,7 +161,7 @@ def spawn(argv, master_read=_read, stdin_read=_read):
 except tty.error:# This is the same as termios.error
 restore = 0
 try:
-_copy(master_fd, master_read, stdin_read)
+_copy(master_fd, master_read, stdin_read, stdout_write)
 except OSError:
 if restore:
 tty.tcsetattr(STDIN_FILENO, tty.TCSAFLUSH, mode)

--
components: Library (Lib)
messages: 322452
nosy: statix
priority: normal
severity: normal
status: open
title: pty.spawn: inconsistent interface
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-26 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Commutativity guarantees can be delivered by sorting arguments before 
> summation.

No thanks -- that's too expensive for such a small payoff.

--

___
Python tracker 

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



[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Commutativity guarantees can be delivered by sorting arguments before 
> summation.

No thanks -- that too expensive for such a small payoff.

--

___
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-07-26 Thread Jimbo Jim


Jimbo Jim  added the comment:

first post in bugs.python.org... are people normally scary around here?

Another usecase of keyword-only arguments is that I can mix default and 
non-default fields in any order. This could be achieved by either marking all 
fields as read-only, or by implicitly adding an asterisk before the first 
"conflicting" non-default argument (or by translating .../etc into an asterisk).

(Is it a bad idea to create a private fork of `pip install dataclasses` with 
implicit asterisk, purely for my own project?)

--
nosy: +Jimbo Jim

___
Python tracker 

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



[issue34137] Add Path.lexist() to pathlib

2018-07-26 Thread Anton Patrushev


Change by Anton Patrushev :


--
nosy: +apatrushev

___
Python tracker 

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



[issue23794] http package should support HTTP/2

2018-07-26 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue34240] Convert test_mmap to use tempfile

2018-07-26 Thread Eryk Sun


Eryk Sun  added the comment:

> tests are competing with each other to delete and recreate the file

When is this an issue? Each parallel test process should have its own working 
directory under "{TEMPDIR}/test_python_{pid}".

--
nosy: +eryksun

___
Python tracker 

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



[issue29750] smtplib doesn't handle unicode passwords

2018-07-26 Thread Windson Yang


Windson Yang  added the comment:

@Vadim Pushtaev I also want to work on it. If you wanna work together. Maybe we 
can talk on zulipchat. :D

--
nosy: +Windson Yang

___
Python tracker 

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



[issue12743] C API marshalling doc contains XXX

2018-07-26 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset defcffdf86780e3a184ebb25dc9a7b807753d57a by Berker Peksag in 
branch 'master':
bpo-12743: Delete comment from marshal.rst (GH-8457)
https://github.com/python/cpython/commit/defcffdf86780e3a184ebb25dc9a7b807753d57a


--

___
Python tracker 

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



[issue12743] C API marshalling doc contains XXX

2018-07-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8011

___
Python tracker 

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



[issue12743] C API marshalling doc contains XXX

2018-07-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8010

___
Python tracker 

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



[issue12743] C API marshalling doc contains XXX

2018-07-26 Thread miss-islington


miss-islington  added the comment:


New changeset 21ed29ac290b10d31dcac947f9246ae4d8b94a86 by Miss Islington (bot) 
in branch '3.7':
bpo-12743: Delete comment from marshal.rst (GH-8457)
https://github.com/python/cpython/commit/21ed29ac290b10d31dcac947f9246ae4d8b94a86


--
nosy: +miss-islington

___
Python tracker 

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



[issue12743] C API marshalling doc contains XXX

2018-07-26 Thread miss-islington


miss-islington  added the comment:


New changeset 146ba436cc0457b8ef7fea8b054b9ccb15e24748 by Miss Islington (bot) 
in branch '3.6':
bpo-12743: Delete comment from marshal.rst (GH-8457)
https://github.com/python/cpython/commit/146ba436cc0457b8ef7fea8b054b9ccb15e24748


--

___
Python tracker 

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



[issue12743] C API marshalling doc contains XXX

2018-07-26 Thread Berker Peksag


Change by Berker Peksag :


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

___
Python tracker 

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



[issue34241] Segfault while Django template rendering

2018-07-26 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34239] Convert test_bz2 to use tempfile

2018-07-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is more reliable to use test.support.unlink().

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34244] Add support of check logger

2018-07-26 Thread Chetan kolhe


New submission from Chetan kolhe :

Add support in logging library which will check whether the logger object 
already created or not .

Module:- logging

Code:-

def check_logger(self, logger_name):
"""
Description :- It will check whether the logger object is already 
present or not .
:param logger_name:

:return: True/False
"""
if Logger.manager.loggerDict.get(logger_name):
return False
else:
return True

--
components: Library (Lib)
messages: 322462
nosy: chetankolhe
priority: normal
severity: normal
status: open
title: Add support of check logger
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



[issue34244] Add support of check logger

2018-07-26 Thread Berker Peksag


Change by Berker Peksag :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue34241] Segfault while Django template rendering

2018-07-26 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Interesting. It works fine with Python 3.6 and latest master but segfaults in 
python 3.7.0 . I will try the latest python 3.7 branch later.

# Python 3.6 on Mac

(bpo34241-env)mysite git:(master)   python
Python 3.6.4 (default, Mar 12 2018, 13:42:53)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

# Changes made

diff --git a/mysite/templates/rest_framework/login_base.html 
b/mysite/templates/rest_framework/login_base.html
index aa91aae..48127ae 100644
--- a/mysite/templates/rest_framework/login_base.html
+++ b/mysite/templates/rest_framework/login_base.html
@@ -68,7 +68,7 @@
   
 
   
-{% trans "Kirjaudu 
sis‰‰n k‰ytt‰en Opintopolun tunnuks." %}
+{% trans "Kirjaudu 
sis‰‰n k‰ytt‰en Opintopolun tunnuksi." %}
   
 
   

# Rendered content

  

  
Kirjaudu sis‰‰n k‰ytt‰en 
Opintopolun tunnuksi.
  

  

# python 3.8

Python 3.8.0a0 (heads/master:defcffd, Jul 27 2018, 04:59:27)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

# diff

diff --git a/mysite/templates/rest_framework/login_base.html 
b/mysite/templates/rest_framework/login_base.html
index aa91aae..48127ae 100644
--- a/mysite/templates/rest_framework/login_base.html
+++ b/mysite/templates/rest_framework/login_base.html
@@ -68,7 +68,7 @@
   
 
   
-{% trans "Kirjaudu 
sis‰‰n k‰ytt‰en Opintopolun tunnuks." %}
+{% trans "Kirjaudu 
sis‰‰n k‰ytt‰en Opintopolun tunnuksi." %}
   
 
   

  

# Content rendered

  

  
Kirjaudu sis‰‰n k‰ytt‰en 
Opintopolun tunnuksi.
  

  


  

# Python 3.7

Python 3.7.0 (default, Jun 28 2018, 02:32:19)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

# segfaults

(bpo34241-37-venv) karthi@ubuntu-s-1vcpu-1gb-blr1-01:~/django-cas-crash/mysite$ 
python manage.py runserver 0.0.0.0:8000
Performing system checks...

System check identified no issues (0 silenced).
July 27, 2018 - 05:34:36
Django version 2.0.7, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Segmentation fault (core dumped)



Thanks

--

___
Python tracker 

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



[issue34240] Convert test_mmap to use tempfile

2018-07-26 Thread Eryk Sun


Eryk Sun  added the comment:

To clarify, TEMPDIR in this case is from the following code in 
Lib/test/libregrtest/main.py:

# When tests are run from the Python build directory, it is best practice
# to keep the test files in a subfolder.  This eases the cleanup of leftover
# files using the "make distclean" command.
if sysconfig.is_python_build():
TEMPDIR = sysconfig.get_config_var('abs_builddir')
if TEMPDIR is None:
# bpo-30284: On Windows, only srcdir is available. Using 
abs_builddir
# mostly matters on UNIX when building Python out of the source 
tree,
# especially when the source tree is read only.
TEMPDIR = sysconfig.get_config_var('srcdir')
TEMPDIR = os.path.join(TEMPDIR, 'build')
else:
TEMPDIR = tempfile.gettempdir()
TEMPDIR = os.path.abspath(TEMPDIR)

Then in class Regrtest we have:

def main(self, tests=None, **kwargs):
global TEMPDIR

if sysconfig.is_python_build():
try:
os.mkdir(TEMPDIR)
except FileExistsError:
pass

# Define a writable temp dir that will be used as cwd while running
# the tests. The name of the dir includes the pid to allow parallel
# testing (see the -j option).
test_cwd = 'test_python_{}'.format(os.getpid())
test_cwd = os.path.join(TEMPDIR, test_cwd)

# Run the tests in a context manager that temporarily changes the CWD 
to a
# temporary and writable directory.  If it's not possible to create or
# change the CWD, the original CWD will be used.  The original CWD is
# available from support.SAVEDCWD.
with support.temp_cwd(test_cwd, quiet=True):
self._main(tests, kwargs)

--

___
Python tracker 

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



[issue34241] Segfault while Django template rendering

2018-07-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Not reproducible in latest 3.7 branch. Search for "django segmentation fault" 
returns me https://bugs.python.org/issue34087 which is also unicode related and 
contains a django test project . I hope the related ticket is the one. From 
https://github.com/python/cpython/pull/8280 it's a regression in 3.7 and it 
doesn't affect 3.6. Feel free to close this if they are related.

Thanks

--

___
Python tracker 

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



[issue34241] Segfault while Django template rendering

2018-07-26 Thread vhelke


vhelke  added the comment:

It certainly seems like https://bugs.python.org/issue34087 is related.
I can also verify that Python 3.7.0+ (latest of now) does not have the problem 
anymore.

I am closing this ticket now. Thank you for looking over this issue. Cheers!

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



[issue28909] Adding LTTng-UST tracing support

2018-07-26 Thread Peter McCormick


Peter McCormick  added the comment:

I would like to propose the following patch[0] which generalizes the 
`PyDTrace_*` definitions to a more generic `PyProbe` structure, in anticipation 
of including LTTng support side-by-side with the existing DTrace support.

A couple of argument types in `Include/pydtrace.h` were also changed to match 
those in `Include/pydtrace.d`. I can split that out to a separate, pre-PyProbe 
patch if that would be preferred.

Some of the `*_ENABLED()` calls were reorganized such that they will actually 
be invoked twice (specifically in `Python/ceval.c` were the enabled check was 
used prior to calling helper functions, which then eventually invoked the 
DTrace macros.) If this won't work, we could add a sequence of 
guarded-by-ifdef-instead-of-enabled calls to ensure that there will only ever 
be one instance of any given `PyDTrace_*_ENABLED()` call.

I've tested compilation on macOS with and without DTrace configured.

Feedback and comments would be most welcome!

Thanks,
Peter

[0] 
https://github.com/pdmccormick/cpython/commit/1e399f5ec381276b52e6a4f5a755fc0f23bd6d97
[1] https://github.com/pdmccormick/cpython/tree/bpo-28909-pyprobe-refactor

--
versions: +Python 3.8 -Python 3.7
Added file: 
https://bugs.python.org/file47715/bpo-28909-pyprobe-refactor-20180727.patch

___
Python tracker 

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



[issue29750] smtplib doesn't handle unicode passwords

2018-07-26 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

That's OK, you can do it.

--

___
Python tracker 

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