[issue37714] 2to3 tab Problems

2019-07-29 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

There is a reindent.py tool to help you in this case. After running the 2to3 on 
the FrisPy, I tried the reindent tool, and the example worked fine afterwards.

$ wget 
https://raw.githubusercontent.com/python/cpython/master/Tools/scripts/reindent.py
$ python3 reindent.py -r .
$ python3 example.py

--
nosy: +aldwinaldwin

___
Python tracker 

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



[issue37714] 2to3 tab Problems

2019-07-29 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue37714] 2to3 tab Problems

2019-07-29 Thread Xinmeng Xia


New submission from Xinmeng Xia :

Traceback (most recent call last):
  File "/home/xxm/Desktop/instrument/datasetpy3/FrisPy/example.py", line 4, in 

import FrisPy
  File "/home/xxm/Desktop/instrument/datasetpy3/FrisPy/FrisPy/__init__.py", 
line 5, in 
from .disc import *
  File "/home/xxm/Desktop/instrument/datasetpy3/FrisPy/FrisPy/disc.py", line 7, 
in 
from . import coefficient_model
  File 
"/home/xxm/Desktop/instrument/datasetpy3/FrisPy/FrisPy/coefficient_model.py", 
line 34
if isinstance(args[0],np.ndarray): args = args[0]
^
TabError: inconsistent use of tabs and spaces in indentation

It seems that it will better to use 4 spaces to replace "tab" in 2to3.

--
components: 2to3 (2.x to 3.x conversion tool)
files: example.py
messages: 348714
nosy: xxm
priority: normal
severity: normal
status: open
title: 2to3  tab Problems
type: compile error
versions: Python 3.7
Added file: https://bugs.python.org/file48513/example.py

___
Python tracker 

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



[issue37713] 2to3 division problems leading to program crashes in Python3

2019-07-29 Thread Zachary Ware


Zachary Ware  added the comment:

This is not a bug; division changed in Python 3 such that `/` is the "true 
division" operator, whereas `//` is the "integer division" operator.

Note that this was actually added in Python 2.2, though it was guarded by `from 
__future__ import division` for the remainder of the 2.x line.

--
components:  -2to3 (2.x to 3.x conversion tool)
nosy: +zach.ware
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue37713] 2to3 division problems leading to program crashes in Python3

2019-07-29 Thread Xinmeng Xia


New submission from Xinmeng Xia :

The snake game will report a crash in Python3:
Traceback (most recent call last):
File "/home/xxm/Desktop/instrument/datasetpy3/Snake_game/runGame.py",line 20, 
in 
w.addch(food[0], food[1], curses.ACS_PI)
TypeError: integer argument expected, got float

food is assigned at line 19 "food = [sh/2, sw/2]"
addch accepts "int" as the types of the first two parameter. In Python2, it 
will work well since the results of division will be "int".In Python3  ,the 
results will be "float"

--
components: 2to3 (2.x to 3.x conversion tool)
files: runGame.py
messages: 348712
nosy: xxm
priority: normal
severity: normal
status: open
title: 2to3 division problems leading to  program crashes in Python3
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48512/runGame.py

___
Python tracker 

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



[issue35083] Fix documentation for __instancecheck__

2019-07-29 Thread Caleb Donovick


Change by Caleb Donovick :


--
nosy: +donovick

___
Python tracker 

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



[issue37709] CSVReader ignores dialect.lineterminator

2019-07-29 Thread Skip Montanaro


Skip Montanaro  added the comment:

I imagine this is a corner case which will continue to cause problems. At the 
time the csv module was originally written, I believe the authors' intent was 
to read and write CSV files which were compatible with Excel. In Python 3, you 
have to open input files in text mode (that provides the underlying line 
splitting behavior). Consequently, you're not going to see proper line 
splitting with unadorned files.

Have you only tried this with Python 3? If you have tried Python 2, were you 
able to get it to work without your workaround?

--

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-07-29 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-07-29 Thread Marco Paolini


Marco Paolini  added the comment:

I forgot to mention, I was inspired by @christian.heimes 's talk at EuroPython 
2019 
https://ep2019.europython.eu/talks/es2pZ6C-introduction-to-low-level-profiling-and-tracing/
 (thanks!)

--

___
Python tracker 

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



[issue37712] Exception frames from unittest.TestCase.fail dependent on nesting

2019-07-29 Thread Matthew Roeschke


New submission from Matthew Roeschke :

With this toy example:

import unittest

def this_fails():
a = 1 + None

class TestExample(unittest.TestCase):

def test_this(self):
try:
this_fails()
except Exception:
self.fail('Fail')

if __name__ == '__main__':
unittest.run()

I get the last frame for each chained exception:

Traceback (most recent call last):
  File "/Users/me/test.py", line 10, in test_this
this_fails()
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/me/test.py", line 12, in test_this
self.fail('Fail')
AssertionError: Fail

But if the toy example contained a nested call, e.g.

def helper(self):
try:
this_fails()
except Exception:
self.fail('Fail')

def test_this(self):
self.helper() 

I get the last 2 frames for each chained exception:

Traceback (most recent call last):
  File "/Users/me/test.py", line 10, in helper
this_fails()
  File "/Users/me/test.py", line 4, in this_fails
a = 1 + None
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/me/test.py", line 15, in test_this
self.helper()
  File "/Users/me/test.py", line 12, in helper
self.fail('Fail')
AssertionError: Fail

Ideally, it would be great if the traceback went back to the root of the 
exception regardless.

--
components: Library (Lib)
messages: 348708
nosy: Matthew Roeschke
priority: normal
severity: normal
status: open
title: Exception frames from unittest.TestCase.fail dependent on nesting
type: behavior
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



[issue37587] JSON loads performance improvement for long strings

2019-07-29 Thread Marco Paolini


Marco Paolini  added the comment:

I am also working on a different patch that uses the "pcmpestri" SSE4 processor 
instruction, it looks like this for now.

While at it I realized there is (maybe) another potential speedup: avoiding the 
ucs4lib_find_max_char we do for each chunk of the string ( that entails 
scanning the string in memory one more time)... anyways that's another (much 
longer) story, probably for another issue?


```
diff --git a/Modules/_json.c b/Modules/_json.c
index 38beb6f50d..25b1cf4a99 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -400,6 +400,38 @@ _build_rval_index_tuple(PyObject *rval, Py_ssize_t idx) {
 Py_CLEAR(chunk); \
 }
 
+
+inline unsigned int
+_fast_search(const void *needle, unsigned int needle_len, const void 
*haystack, unsigned int haystack_len)
+{
+  unsigned int pos;
+  __asm__ __volatile__("movq (%1), %%xmm1;\n"
+   "mov %2, %%eax;\n"
+   "movq %3, %%r8;\n"
+   "mov %4, %%edx;\n"
+   ".intel_syntax noprefix;\n"
+   "loop: pcmpestri xmm1, [r8], 0;\n" /* 0 = equal any */
+   /* "pcmpestri %%mm1, (%%r8), $0;\n" /\* 0 = equal any 
*\/ */
+   ".att_syntax prefix;\n"
+   "cmp $15, %%ecx;\n"
+   "jbe found;\n"
+   "sub $16, %%edx;\n"
+   "jnge notfound;\n"
+   "add $16, %%r8;\n"
+   "jmp loop;\n"
+   "notfound: movl %4, %%ecx;\n"
+   "jmp exit;\n"
+   "found: mov %4, %%eax;\n"
+   "sub %%edx, %%eax;\n"
+   "add %%eax, %%ecx;\n"
+   "exit: mov %%ecx, %0;\n"
+   :"=m"(pos)
+   :"r"(needle), "r"(needle_len), "r"(haystack), 
"r"(haystack_len)
+   :"%eax", "%edx", "%ecx", "%r8", "%xmm1");
+  return pos;
+}
+
+
 static PyObject *
 scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t 
*next_end_ptr)
 {
@@ -431,17 +463,26 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int 
strict, Py_ssize_t *next
 PyErr_SetString(PyExc_ValueError, "end is out of bounds");
 goto bail;
 }
+char needle[2];
+needle[0] = '"';
+needle[1] = '\\';
 while (1) {
 /* Find the end of the string or the next escape */
 Py_UCS4 c = 0;
-for (next = end; next < len; next++) {
+if (kind == PyUnicode_1BYTE_KIND) {
+  next = _fast_search(needle, 2, buf+end, len-end) + end;
+  if (next < len)
 c = PyUnicode_READ(kind, buf, next);
-if (c == '"' || c == '\\') {
-break;
-}
-else if (strict && c <= 0x1f) {
-raise_errmsg("Invalid control character at", pystr, next);
-goto bail;
+} else {
+for (next = end; next < len; next++) {
+c = PyUnicode_READ(kind, buf, next);
+if (c == '"' || c == '\\') {
+break;
+}
+else if (strict && c <= 0x1f) {
+raise_errmsg("Invalid control character at", pystr, next);
+goto bail;
+}
 }
 }
 if (!(c == '"' || c == '\\')) {
```

--

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-07-29 Thread Marco Paolini


Marco Paolini  added the comment:

On gcc, running the tests above, the only change that is relevant for speedup 
is switching around the strict check. Removing the extra MOV related to the 
outer "c" variable is not significant (at least on gcc and the few tests I did)

Unfortunately I had to change the patch we did together during the sprint 
because it was breaking the strict check logic...

I updated my PR accordingly, kept only the bare minimum.

--

___
Python tracker 

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



[issue37268] Deprecate the parser module

2019-07-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Any update on deprecating the parser module?

Wish granted: PR 15017

--

___
Python tracker 

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



[issue37268] Deprecate the parser module

2019-07-29 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue37069] regrtest: log unraisable exceptions and uncaught thread exceptions

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

regrtest now uses :func:`sys.unraisablehook` to mark a test as "environment 
altered" (ENV_CHANGED) if it emits an "unraisable exception".

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



[issue37268] Deprecate the parser module

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Yep, will make a PR soon.

Any update on deprecating the parser module?

--

___
Python tracker 

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



[issue37313] test_concurrent_futures stopped after 25 hours on AMD64 Windows7 SP1 3.7

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

The root issue will be solved by bpo-37531: ensure that regrtest kills a worker 
process if it takes longer than TIMEOUT seconds.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Fix regrtest timeout for subprocesses: regrtest -jN 
--timeout=SECONDS

___
Python tracker 

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



[issue37314] Compilation failed on AMD64 Debian root 3.8: undefined reference to _PyTraceMalloc_NewReference

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

I didn't see the failure on this buildbot recently, so I close the issue.

--
resolution:  -> out of date
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



[issue37359] test_regrtest: test_list_cases() fails on x86 Gentoo Installed with X 3.x

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

The current status is that regrtest has a new --cleanup command but it's not 
used. regrtest should not leak temporary files anymore.

The remaining issue is when regrtest re-runs tests sequentially and a test does 
crash the regrtest main process. In this case, the temporary directory is not 
removed.

I created bpo-37711 "regrtest: re-run failed tests in subprocesses" for this 
case. The initial issue has been fixed, so I close the issue.

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

___
Python tracker 

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



[issue37711] regrtest: re-run failed tests in subprocesses

2019-07-29 Thread STINNER Victor


Change by STINNER Victor :


--
title: regrtest: re-run tests in subprocesses -> regrtest: re-run failed tests 
in subprocesses

___
Python tracker 

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



[issue37711] regrtest: re-run tests in subprocesses

2019-07-29 Thread STINNER Victor


New submission from STINNER Victor :

When using python3 -m test -w, failed tests are re-run in the regrtest main 
process, even if -jN option is used. If a test does crash, regrtest doesn't 
remove its temporary directory which can lead to random test failures like 
bpo-37359.

At least when using -jN, I suggest to run tests in a subprocess to ensure that 
regrtest is able to cleanup its temporary directory, even if a test does crash.

--
components: Tests
messages: 348700
nosy: vstinner
priority: normal
severity: normal
status: open
title: regrtest: re-run tests in subprocesses
versions: Python 3.9

___
Python tracker 

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



[issue37386] [EASY] test_io: test_large_file_ops() failed on AMD64 Windows7 SP1 3.x with: [Errno 28] No space left on device

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

According to Serhiy, the right solution is to contact buildbot owners to ask 
them to ensure that all workers have enough free disk space: at least 2 GiB.

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



[issue37474] Should Py_Initialize() control the floating point mode?

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

fp_except.c: C program to test for float point exceptions:

* FE_OVERFLOW
* FE_UNDERFLOW
* FE_INVALID

I prefer to avoid testing FE_INEXACT which a test might be too specific to an 
implementation of the libm.

I also chose to avoid testing FE_DIVBYZERO, since the default behavior is to 
kill the process with SIGFPE.

--
Added file: https://bugs.python.org/file48511/fp_except.c

___
Python tracker 

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



[issue1047397] cgitb failures

2019-07-29 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +Rhodri James, ethan.furman

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-07-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset e941cbcf8c2fce59a9afa8043948f9a147e09177 by Terry Jan Reedy in 
branch '3.7':
bpo-34162: Update idlelib/news.txt for 3.7.5 (GH-15016)
https://github.com/python/cpython/commit/e941cbcf8c2fce59a9afa8043948f9a147e09177


--

___
Python tracker 

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



[issue37474] Should Py_Initialize() control the floating point mode?

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

> The current FreeBSD documentation for fedisableexcept says: All exceptions 
> are masked by default.

The fedisableexcept manual page says that since this manual page was added to 
FreeBSD 6.0 which was released in 2005.

Python started to tune FPU control on FreeBSD in 2002.

Should I understand that fedisableexcept(FE_OVERFLOW) is useless since FreeBSD 
6?

I'm also surprised that I never saw any complain about that on other BSD: 
OpenBSD, NetBSD, macOS, etc. It seems like the fedisableexcept(FE_OVERFLOW) 
call is useless since a long time.

--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-07-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +14779
pull_request: https://github.com/python/cpython/pull/15016

___
Python tracker 

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



[issue37354] Write PowerShell Activate.ps1 to be static so it can be signed

2019-07-29 Thread Steve Dower


Steve Dower  added the comment:

I just chatted with Derek about this, and while we identified some potential 
regressions (previously we were injecting str(prompt) into Activate.ps1, and 
now we're showing repr(prompt)), I don't think they're widely used.

For example, if you previously did:

>>> py -m venv --prompt "my`nprompt" env

You'd get 'my\nprompt' in pyvenv.cfg, but an actual newline in your printed 
prompt (note that passing "my\nprompt" in the command doesn't do this). There 
are likely other things that will be escaped in the configuration that 
previously would have been fine with the direct substitution.

I have no real sense of how widely used these are. They are definitely less 
popular than machines that are configured to require code-signed Powershell 
scripts, so we still come out ahead. It's probably easy to handle some of the 
more common escapes, if we know what they are, but I doubt we're going to 
reimplement full Python string parsing in a Powershell script.

Vinay - any thoughts here? For me, I think get it out in 3.8.0b4 and see how it 
fares.

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



[issue37354] Write PowerShell Activate.ps1 to be static so it can be signed

2019-07-29 Thread Derek Keeler


Change by Derek Keeler :


--
nosy: +d3r3kk

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-07-29 Thread miss-islington


miss-islington  added the comment:


New changeset 8b50e3e2729190d4b65ee9510d81f01bd31f2f7c by Miss Islington (bot) 
in branch '3.8':
bpo-34162: Update idlelib/news.txt. (GH-15011)
https://github.com/python/cpython/commit/8b50e3e2729190d4b65ee9510d81f01bd31f2f7c


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-07-29 Thread miss-islington


miss-islington  added the comment:


New changeset 6c9f46fa3a90eeb02c35ba0e92e7f75edc67e51d by Miss Islington (bot) 
in branch '3.7':
bpo-34162: Update idlelib/news.txt. (GH-15011)
https://github.com/python/cpython/commit/6c9f46fa3a90eeb02c35ba0e92e7f75edc67e51d


--

___
Python tracker 

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



[issue37706] IDLE test_sidebar test_(click/drag)_selection fail on macOS 8.6

2019-07-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Tests disabled, leaving open for live behavior report.

--
nosy:  -miss-islington
stage: patch review -> needs patch
title: IDLE test_sidebar testcases test_click_selection and test_drag_selection 
can fail on macOS -> IDLE test_sidebar test_(click/drag)_selection fail on 
macOS 8.6

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread miss-islington


miss-islington  added the comment:


New changeset ad36d21223fd8118af8dbcf55ead03ee5905e7c3 by Miss Islington (bot) 
in branch '3.7':
bpo-37706: Disable 3 IDLE scrollbar tests on Mac. (GH-15010)
https://github.com/python/cpython/commit/ad36d21223fd8118af8dbcf55ead03ee5905e7c3


--

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread miss-islington


miss-islington  added the comment:


New changeset 8513b90e114a815ebf4b389bcdfb08b49207a751 by Miss Islington (bot) 
in branch '3.8':
bpo-37706: Disable 3 IDLE scrollbar tests on Mac. (GH-15010)
https://github.com/python/cpython/commit/8513b90e114a815ebf4b389bcdfb08b49207a751


--
nosy: +miss-islington

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14778
pull_request: https://github.com/python/cpython/pull/15015

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14777
pull_request: https://github.com/python/cpython/pull/15014

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-07-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset f35c51d2eadd297bcf06d4f7c536bd1d8682b724 by Terry Jan Reedy in 
branch 'master':
bpo-34162: Update idlelib/news.txt. (#15011)
https://github.com/python/cpython/commit/f35c51d2eadd297bcf06d4f7c536bd1d8682b724


--

___
Python tracker 

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



[issue33820] IDLE subsection of What's New 3.6

2019-07-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
superseder:  -> IDLE subsection of What's New 3.7

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2019-07-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Release peps -- needed for proposed and actual release dates.
3.7 PEP 537 https://www.python.org/dev/peps/pep-0537/
3.8 PEP 569 https://www.python.org/dev/peps/pep-0569/
3.9 PEP 596 https://www.python.org/dev/peps/pep-0596/

--

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14776
pull_request: https://github.com/python/cpython/pull/15013

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-07-29 Thread Eryk Sun


Eryk Sun  added the comment:

> It sounds like we should probably revert to the middle ground, and 
> skip _raising the error_ if _Py_set_inheritable for files of type
> FILE_TYPE_CHAR.

The problem is just console pseudohandles in Windows 7 and earlier.  Maybe it 
should just check for this case before calling SetHandleInformation. For 
example:

/* This check can be removed once support for Windows 7 ends. */
#define CONSOLE_PSEUDOHANDLE(handle) (((ULONG_PTR)(handle) & 0x3) == 0x3 && 
\
GetFileType(handle) == FILE_TYPE_CHAR)

if (!CONSOLE_PSEUDOHANDLE(handle) &&
!SetHandleInformation(handle, HANDLE_FLAG_INHERIT, flags)) {
if (raise)
PyErr_SetFromWindowsErr(0);
return -1;
}

We have similar Python code in subprocess Popen._filter_handle_list, which 
filters out console pseudohandles because they don't work with 
PROC_THREAD_ATTRIBUTE_HANDLE_LIST.

A similar check could be added to os_set_handle_inheritable_impl in 
Modules/posixmodule.c.

> As Victor pointed out, the docs already call out the special case in 
> Windows. 

For os.dup it says

On Windows, when duplicating a standard stream (0: stdin, 1: 
stdout, 2: stderr), the new file descriptor is inheritable.

The standard handles aren't relevant.

Also, under "inheritance of file descriptors", it says:

On Windows, non-inheritable handles and file descriptors are closed 
in child processes, except for standard streams (file descriptors 0,
1 and 2: stdin, stdout and stderr), which are always inherited.

The standard handles aren't always inherited. If bInheritHandles is TRUE (i.e. 
close_fds=False), a standard handle has to be iheritable for it to be 
inherited. 

For example, in Windows 10, make stderr (a ConDrv console handle) 
non-inheritable and create a child process with close_fds=False:

>>> os.set_handle_inheritable(msvcrt.get_osfhandle(2), False)
>>> cmd = 'import sys; print(sys.stderr)'
>>> subprocess.call(f'python.exe -c "{cmd}"', close_fds=False)
None
0

In Windows 7 and earlier, it seems that inheritable console pseudohandles are 
always inherited, regardless of bInheritHandles -- as long as the child process 
attaches to the parent's console. SetHandleInformation isn't supported for 
console pseudohandles, but the inheritable flag is still set or cleared when a 
console pseudohandle is created via CreateConsoleScreenBuffer, CreateFileW 
(routed to OpenConsoleW), and DuplicateHandle (routed to 
DuplicateConsoleHandle).

It's worth mentioning that the system sometimes duplicates (not inherits) 
standard handles to a child process. A simple example in Windows 10 would be 
subprocess.call('python.exe'). 

All of the follow requirements must be satisfied for CreateProcessW to 
duplicate a standard handle to a child:

* it's not a console pseudohandle (e.g. it's a ConDrv console handle in 
  Windows 8+, or handle for the NUL device, a pipe, or disk file)
* the target executable is a console application (e.g. python.exe, not 
  pythonw.exe)
* handle inheritance is disabled (i.e. bInheritHandles is FALSE)
* the startup-info standard handles aren't used (i.e. 
  STARTF_USESTDHANDLES isn't set)
* the call isn't flagged to execute without a console or to allocate a
  new console (i.e. no DETACHED_PROCESS, CREATE_NEW_CONSOLE, or 
  CREATE_NO_WINDOW)

In this case, CreateProcessW also has to update the handle value in the child 
since generally the duplicate has a new value. With inheritance, in contrast, 
the handle value is the same in the parent and child.

--

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14775
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15012

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset e8874b85b4e3bbb735467b0beaa933dcef362004 by Terry Jan Reedy in 
branch 'master':
bpo-37706: Disable 3 IDLE scrollbar tests on Mac. (#15010)
https://github.com/python/cpython/commit/e8874b85b4e3bbb735467b0beaa933dcef362004


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-07-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +14774
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/15011

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

IDLE tests passed the Azure macOS test (when it does not timeout) before and 
since #17535 was merged.  So this failure report initially surprised me.  But 
then I checked Display Build Info on
https://dev.azure.com/Python/cpython/_build/results?buildId=47634=logs=18d1a34d-6940-5fc1-f55b-405e2fba32b1

tkinter.TCL_VERSION: 8.5
tkinter.TK_VERSION: 8.5
tkinter.info_patchlevel: 8.5.9

Oh dear. Azure is testing Tkinter, Turtle, and IDLE with Apple's ancient, 
buggy, and somewhat obsolete system tcl/tk, which we do not support. 

Steve, for years we have closed issues reporting failures and crashes with 
8.5.9 and told users to install something more recent.
https://www.python.org/download/mac/tcltk/
We now directly supply something current in the Mac installer.  We need 
tkinter, etc, tested on macOS with the tcl/tk that we support and supply, just 
like Azure does on Windows.  

tkinter.TCL_VERSION: 8.6
tkinter.TK_VERSION: 8.6
tkinter.info_patchlevel: 8.6.9

Ned, for the present, we should skip the tests on Mac. If the code and test 
were made to work on 8.6.x, they might well fail on 8.5.9.  PR 15010.  You will 
have to un-comment the skips to test for real.

What behavior do users see.  Can you check?  The test says that clicking on 
line 2 selects line 1.  Does it?  That would be awful. What does click and drag 
do?  Given the off-by-one reports, I made the text five lines so that a 3-line 
drag should have unselected lines above and below.  I added a test for drag up 
as well as down.

--
nosy: +steve.dower
stage: patch review -> needs patch

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue37710] Python SSL module does not clear error queue before IO operations using SSL_get_error

2019-07-29 Thread Andrew Collins


New submission from Andrew Collins :

Per the OpenSSL documentation:

"The current thread's error queue must be empty before the TLS/SSL I/O 
operation is attempted, or SSL_get_error() will not work reliably."

https://www.openssl.org/docs/man1.1.1/man3/SSL_get_error.html

Modules/_ssl.c does clear errors on socket creation, and upon handling an error 
itself, but does not clear before IO operations that are checked with 
SSL_get_error.

When using OpenSSL outside of Modules/_ssl.c in the same process context (for 
example, using libssh through python bindings), this can results in random ssl 
errors being picked up by Modules/_ssl.c.

--
assignee: christian.heimes
components: SSL
messages: 348684
nosy: Andrew Collins, christian.heimes
priority: normal
severity: normal
status: open
title: Python SSL module does not clear error queue before IO operations using 
SSL_get_error
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37709] CSVReader ignores dialect.lineterminator

2019-07-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems related : https://bugs.python.org/issue1072404 . There is a note on docs 
that it's ignored and may be changed in future. 
https://docs.python.org/3/library/csv.html

--
nosy: +skip.montanaro, xtreak

___
Python tracker 

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



[issue37708] Harmonize random.choice(s) behavior with random.sample on iterators

2019-07-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems similar to https://bugs.python.org/issue37682

--
nosy: +rhettinger, xtreak

___
Python tracker 

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



[issue37709] CSVReader ignores dialect.lineterminator

2019-07-29 Thread Benjamin Schollnick


New submission from Benjamin Schollnick :

I've run into a situation where the CSV input file is very unusual.  The 
Delimiter is "\x06" and the lineterminator is "\x07".

While I've written code to work around this, it would be significantly nicer if 
the CSV Reader code actually paid attention to the dialect's lineterminator 
value.

--
components: Library (Lib)
messages: 348681
nosy: Benjamin Schollnick
priority: normal
severity: normal
status: open
title: CSVReader ignores dialect.lineterminator
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



[issue37708] Harmonize random.choice(s) behavior with random.sample on iterators

2019-07-29 Thread Lex Flagel


New submission from Lex Flagel :

It would be nice to make random.sample and random.choice both have the same 
behavior with iterators. Currently random.sample accepts them happily, and 
whereas random.choice does not.  E.g.

> import random
> d = {'a':1, 'b':2}
> random.sample(d.keys(),1)
Out: ['a']

> random.choice(d.keys())
Out: TypeError: 'dict_keys' object is not subscriptable

random.choice could be redefined as follows to harmonize behavior, but I think 
the solution for random.choices maybe be more involved:

def choice(x): 
random.sample(x,1)[0]

--
components: Library (Lib)
messages: 348680
nosy: Lex Flagel
priority: normal
severity: normal
status: open
title: Harmonize random.choice(s) behavior with random.sample on iterators
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



[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-29 Thread Brett Cannon


Brett Cannon  added the comment:

Changing the semantics of os.path.isdir() for something like this isn't worth 
breaking code; basically it's now a quirk of the function.

--

___
Python tracker 

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



[issue37689] Add Path.is_relative_to()

2019-07-29 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-29 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I think expanding the list of tests used by --pgo is fine, as long as we put a 
little thought into each one we add.  The ones added by Steve look fine to me.

It seems useful to run a profiler and see if there are any unusually expensive 
tests being added.  I used 'cprofile' and found a few candidates.  See bug 
#37707 and PR 15009.

--

___
Python tracker 

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



[issue37707] Skip individual unit tests that are expensive for the PGO task

2019-07-29 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
keywords: +patch
pull_requests: +14772
pull_request: https://github.com/python/cpython/pull/15009

___
Python tracker 

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



[issue37496] Support annotations in signature strings.

2019-07-29 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy:  -nanjekyejoannah

___
Python tracker 

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



[issue14817] pkgutil.extend_path has no tests

2019-07-29 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy:  -nanjekyejoannah

___
Python tracker 

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



[issue33150] Signature error for methods of class configparser.Interpolation

2019-07-29 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy:  -nanjekyejoannah

___
Python tracker 

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



[issue37707] Skip individual unit tests that are expensive for the PGO task

2019-07-29 Thread Neil Schemenauer


New submission from Neil Schemenauer :

Add a new support decorator, @skip_if_pgo_task and then use it to mark test 
cases.  I suspect the PGO task works well if it can exercise common code paths. 
 Running long tests likely have rapidly diminishing benefits.  The instrumented 
PGO executable runs quite a bit slower than a normal build and so it is useful 
to spend a bit of time to exclude expensive tests.

--
components: Build
messages: 348677
nosy: nascheme
priority: normal
severity: normal
stage: patch review
status: open
title: Skip individual unit tests that are expensive for the PGO task
type: enhancement

___
Python tracker 

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



[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-07-29 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy:  -nanjekyejoannah

___
Python tracker 

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



[issue11953] Missing WSA* error codes

2019-07-29 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy:  -nanjekyejoannah

___
Python tracker 

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



[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2019-07-29 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy:  -nanjekyejoannah

___
Python tracker 

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



[issue37653] make install fails

2019-07-29 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

A trick w.r.t. comments in command-lines is to use the ":" command, that's a 
no-op shell command that ignores its arguments (although you do need to take 
care with shell special characters as it is just a command like any other).

--

___
Python tracker 

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



[issue37690] Simplify linking of shared libraries on the AIX OS

2019-07-29 Thread Eric N. Vander Weele


Eric N. Vander Weele  added the comment:

Thanks for the in-depth responses and feedback.

When reinvestigating this in more detail that led me to create this patch, I 
discovered that the premise upon which I was operating upon was not the default 
(desired) compiler and linker flags.  It turns out the environment I am working 
in builds all of the software using -bsvr4 and -brtl on AIX.

I have a lot more to unravel now.  I already closed the PR and will abandon 
this issue since it has been clearly illustrated that this is masking an 
underlying problem.

Thanks for taking the time to provide feedback and detail of what is 
problematic with this change.

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-07-29 Thread Steve Dower


Steve Dower  added the comment:

> What 3.7.3 does is to skip calling _Py_set_inheritable for all files of type 
> FILE_TYPE_CHAR

It sounds like we should probably revert to the middle ground, and skip 
_raising the error_ if _Py_set_inheritable for files of type FILE_TYPE_CHAR.

As Victor pointed out, the docs already call out the special case in Windows. 
Since this applies to Windows 7, which will be EOL only a couple months after 
3.8's release, I think it's fine to have the slightly less secure behavior and 
just suppress the error.

--

___
Python tracker 

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



[issue37633] Py_CompileString and PyParser_SimpleParseString not exported in python38.dll

2019-07-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue37653] make install fails

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

Crap. That's why I didn't want to put the comment "inside" the code, but as 
separated commands. Well, I learnt something today: bash is the standard :-)

--

___
Python tracker 

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



[issue30755] locale.normalize() and getdefaultlocale() convert C.UTF-8 to en_US.UTF-8

2019-07-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue10819] ValueError on repr(closed_socket_file)

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is closed. Please open a new issue.

--

___
Python tracker 

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



[issue15987] Provide a way to compare AST nodes for equality recursively

2019-07-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

Honestly, I'm not sure of what is the right solution for this issue.

--

___
Python tracker 

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



[issue37689] Add Path.is_relative_to()

2019-07-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread Tal Einat


Tal Einat  added the comment:

Unfortunately, my Mac is out of order, so I am unable to diagnose and fix this. 
I hope to be able to do so again in a few weeks.

--

___
Python tracker 

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



[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will close this for now, we can revisit this if we find a better solution for 
the 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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14771
pull_request: https://github.com/python/cpython/pull/15005

___
Python tracker 

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



[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-29 Thread miss-islington


miss-islington  added the comment:


New changeset 9ea738e580f58c3d2f9b0d56561d57b9e9412973 by Miss Islington (bot) 
in branch '3.8':
bpo-37500: Make sure dead code does not generate bytecode but also detect 
syntax errors (GH-14612)
https://github.com/python/cpython/commit/9ea738e580f58c3d2f9b0d56561d57b9e9412973


--

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread Ned Deily


Ned Deily  added the comment:

> tested on 10.14 with Tk 8.6.8 and 8.6.0
er, make that "8.6.9" not "8.6.0"

--

___
Python tracker 

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



[issue11953] Missing WSA* error codes

2019-07-29 Thread Ngalim Siregar


Change by Ngalim Siregar :


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

___
Python tracker 

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



[issue37706] IDLE test_sidebar testcases test_click_selection and test_drag_selection can fail on macOS

2019-07-29 Thread Ned Deily


New submission from Ned Deily :

On macOS, there are two test failure seen with test_sidebar (tested on 10.14 
with Tk 8.6.8 and 8.6.0 - the failures should be reproducible with the 
python.org 3.8.0b3 installer for macOS which will be available soon.)

==
FAIL: test_click_selection (idlelib.idle_test.test_sidebar.LineNumbersTest)
--
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/idlelib/idle_test/test_sidebar.py",
 line 253, in test_click_selection
self.assertEqual(self.get_selection(), ('2.0', '3.0'))
AssertionError: Tuples differ: ('1.0', '2.0') != ('2.0', '3.0')

First differing element 0:
'1.0'
'2.0'

- ('1.0', '2.0')
+ ('2.0', '3.0')

==
FAIL: test_drag_selection (idlelib.idle_test.test_sidebar.LineNumbersTest)
--
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/idlelib/idle_test/test_sidebar.py",
 line 273, in test_drag_selection
self.assertEqual(self.get_selection(), ('1.0', '4.0'))
AssertionError: Tuples differ: ('1.0', '3.0') != ('1.0', '4.0')

First differing element 1:
'3.0'
'4.0'

- ('1.0', '3.0')
?  ^

+ ('1.0', '4.0')
?  ^


--

--
assignee: terry.reedy
components: IDLE
messages: 348666
nosy: ned.deily, taleinat, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE test_sidebar testcases test_click_selection and test_drag_selection 
can fail on macOS
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue36002] configure --enable-optimizations with clang fails to detect llvm-profdata

2019-07-29 Thread Doyle Rowland


Doyle Rowland  added the comment:

../configure LLVM_PROFDATA=//llvm-profdata --enable-optimizations is 
also work-around.

--
nosy: +weibullguy

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +14769
pull_request: https://github.com/python/cpython/pull/15003

___
Python tracker 

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



[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14768
pull_request: https://github.com/python/cpython/pull/15002

___
Python tracker 

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



[issue37603] parsetok(): Assertion `(intptr_t)(int)(a - line_start) == (a - line_start)' failed, when running get-pip.py

2019-07-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I just merged PR 14433

--

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread Anthony Sottile


Anthony Sottile  added the comment:

sure! the only other case I could come up with involves multi-line strings and 
invalid escape sequences + Werror

let me see if I can fold that in as well

--

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks Anthony Sottile for the fix!

I suggest adding more test cases that do not involve f-strings, what do you 
think? Can you create another PR for those?

--
nosy: +pablogsal

___
Python tracker 

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



[issue37433] syntax error in multiline f-string produces ~40k spaces output

2019-07-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14767
pull_request: https://github.com/python/cpython/pull/15001

___
Python tracker 

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



[issue37705] winerror_to_errno implementation

2019-07-29 Thread Eryk Sun


New submission from Eryk Sun :

OSError and _Py_fstat_noraise rely on winerror_to_errno() in PC/errmap.h in 
order to translate a Windows system error code into a POSIX errno value. 
PC/errmap.h is supposed to be generated by PC/generrmap.c, which is based on 
the old CRT's _dosmapperr() function. However, this function isn't implemented 
in the Universal CRT, and ucrt's corresponding function, 
__acrt_errno_from_os_error, isn't exported for public use.

If generrmap.c is effectively dead, then it's no longer possible to add custom 
mappings there, as was done for issue 12802 (ERROR_DIRECTORY -> ENOTDIR) and 
issue 13063 (ERROR_NO_DATA -> EPIPE). Also, errmap.h hasn't been regenerated in 
8 years, and since then the CRT added a new mapped value: 
ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ. 

Unless someone can suggest a way to continue automatically generating errmap.h 
via generrmap.c, then I think winerror_to_errno should be manually implemented 
in a more readable and maintainable way, and updated from the ucrt source 
(ucrt\misc\errno.cpp) with each major Python release. The implementation could 
use a switch statement like it currently does, but with named error codes, 
grouped by result. For example:

int
winerror_to_errno(int winerror)
{
switch(winerror) {
case ERROR_FILE_NOT_FOUND://2
case ERROR_PATH_NOT_FOUND://3
case ERROR_INVALID_DRIVE: //   15
case ERROR_NO_MORE_FILES: //   18
case ERROR_BAD_NETPATH:   //   53
case ERROR_BAD_NET_NAME:  //   67
case ERROR_BAD_PATHNAME:  //  161
case ERROR_FILENAME_EXCED_RANGE:  //  206
return ENOENT;

case ERROR_BAD_ENVIRONMENT:   //   10
return E2BIG;

case ERROR_BAD_FORMAT://   11
case ERROR_INVALID_STARTING_CODESEG:  //  188
case ERROR_INVALID_STACKSEG:  //  189
case ERROR_INVALID_MODULETYPE://  190
case ERROR_INVALID_EXE_SIGNATURE: //  191
case ERROR_EXE_MARKED_INVALID://  192
case ERROR_BAD_EXE_FORMAT://  193
case ERROR_ITERATED_DATA_EXCEEDS_64k: //  194
case ERROR_INVALID_MINALLOCSIZE:  //  195
case ERROR_DYNLINK_FROM_INVALID_RING: //  196
case ERROR_IOPL_NOT_ENABLED:  //  197
case ERROR_INVALID_SEGDPL://  198
case ERROR_AUTODATASEG_EXCEEDS_64k:   //  199
case ERROR_RING2SEG_MUST_BE_MOVABLE:  //  200
case ERROR_RELOC_CHAIN_XEEDS_SEGLIM:  //  201
case ERROR_INFLOOP_IN_RELOC_CHAIN://  202
return ENOEXEC;

case ERROR_INVALID_HANDLE://6
case ERROR_INVALID_TARGET_HANDLE: //  114
case ERROR_DIRECT_ACCESS_HANDLE:  //  130
return EBADF;

case ERROR_WAIT_NO_CHILDREN:  //  128
case ERROR_CHILD_NOT_COMPLETE://  129
return ECHILD;

case ERROR_NO_PROC_SLOTS: //   89
case ERROR_MAX_THRDS_REACHED: //  164
case ERROR_NESTING_NOT_ALLOWED:   //  215
return EAGAIN;

case ERROR_ARENA_TRASHED: //7
case ERROR_NOT_ENOUGH_MEMORY: //8
case ERROR_INVALID_BLOCK: //9
case ERROR_NOT_ENOUGH_QUOTA:  // 1816
return ENOMEM;

case ERROR_ACCESS_DENIED: //5
case ERROR_CURRENT_DIRECTORY: //   16
case ERROR_WRITE_PROTECT: //   19
case ERROR_BAD_UNIT:  //   20
case ERROR_NOT_READY: //   21
case ERROR_BAD_COMMAND:   //   22
case ERROR_CRC:   //   23
case ERROR_BAD_LENGTH://   24
case ERROR_SEEK:  //   25
case ERROR_NOT_DOS_DISK:  //   26
case ERROR_SECTOR_NOT_FOUND:  //   27
case ERROR_OUT_OF_PAPER:  //   28
case ERROR_WRITE_FAULT:   //   29
case ERROR_READ_FAULT://   30
case ERROR_GEN_FAILURE:   //   31
case ERROR_SHARING_VIOLATION: //   32
case ERROR_LOCK_VIOLATION://   33
case ERROR_WRONG_DISK://   34
case ERROR_SHARING_BUFFER_EXCEEDED:   //   36
case ERROR_NETWORK_ACCESS_DENIED: //   65
case ERROR_CANNOT_MAKE:   //   82
case ERROR_FAIL_I24:  //   83
case ERROR_DRIVE_LOCKED:  //  108
case ERROR_SEEK_ON_DEVICE://  132
case ERROR_NOT_LOCKED://  158
case ERROR_LOCK_FAILED:   //  167
case 35:  //   35 [undefined]
return EACCES;

[issue37603] parsetok(): Assertion `(intptr_t)(int)(a - line_start) == (a - line_start)' failed, when running get-pip.py

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

> This is marked as release blocker but since BPO-37433 is still in review, I'm 
> releasing 3.0b3 as is. Please resolve this by b4, I will block the last beta 
> on this issue.

That sounds reasonable to me.

FYI I just approved (but not merged) PR 14433.

--

___
Python tracker 

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



[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am fine with backporting the 3.9 solution to 3.8. Sorry for the delay.

--

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-29 Thread Steve Dower


Steve Dower  added the comment:

Thanks for approving my PR, Greg!

--

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-29 Thread Steve Dower


Steve Dower  added the comment:

> What matters there is compiling the underlying lzma, bz2, and sqlite3 
> libraries with PGO.  that isn't done as part of our build system.

On Windows they are linked in as source files, which is why it matters for us. 
On platforms where we rely on system libraries for this it doesn't matter.

We currently don't PGO OpenSSL on Windows, which would probably be nice but is 
much harder to set up as we use their build scripts. Libffi is built in our 
build though, so adding ctypes would get that covered, but I'm not so worried 
about it.

--

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-07-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

This is marked as release blocker but since there is no movement on the 
possible solution, I'm releasing 3.80b3 without a fix. Please resolve this by 
b4, I will block the last beta on this issue.

--

___
Python tracker 

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



[issue37603] parsetok(): Assertion `(intptr_t)(int)(a - line_start) == (a - line_start)' failed, when running get-pip.py

2019-07-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

This is marked as release blocker but since BPO-37433 is still in review, I'm 
releasing 3.0b3 as is. Please resolve this by b4, I will block the last beta on 
this issue.

--

___
Python tracker 

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



[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Victor closed the 3.8 backport, stating on GitHub:

"I closed the 3.8 backport (without merging it), until we agree on what should 
be done."

This is marked as release blocker. I will be releasing 3.8b3 as is, please 
decide what to do here before b4, I will block the last beta on this issue.

--

___
Python tracker 

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



[issue37669] Make mock_open return per-file content

2019-07-29 Thread Damien Nadé

Damien Nadé  added the comment:

To summarize the change I'm proposing, I'd say that instead of having mock_open 
creating closures (functions inside a specific context), mock_open now creates 
objects that will hold the contexts. Each context would be filename-dedicated 
and would include specific 'read_data' and linked MagikMock object.

So the change is fully transparent compared to the currently-existing 
mock_open. It just brings a little extra something, in the way of an extra 
parameter to mock_open : 

mock_open(mock, read_data, data)

While the name 'data' obviously can (and should) be replaced before merge (I 
dont have a "good" name in mind ATM, feel free to suggest), I'm suggesting in 
my PR that it could be a {: } mapping.

e.g: If i call

mock_open(read_data="default read data", data={"/foo": "abc", "/asdf/bar": 
"xyz"})

Then, after mock.patching open, I can assert the following:

assert open("random file").read() == "default read data"
assert open("/foo").read() == "abc"
assert open("/bar").read() == "xyz"

And so far, that's all I'm proposing... But I'm really open to suggestion on 
that.

--

___
Python tracker 

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



[issue15454] Allow dircmp.report() output stream to be customized

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is not newcomer friendly, I remove the easy keyword.

--
keywords:  -easy
nosy: +vstinner

___
Python tracker 

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



[issue5256] rlcompleter adds builtins when custom dict is used

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is not newcomer friendly, I remove the easy keyword.

--
keywords:  -easy
nosy: +vstinner

___
Python tracker 

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



[issue12436] Missing items in installation/setup instructions

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is not newcomer friendly, I remove the easy keyword.

--
keywords:  -easy
nosy: +vstinner

___
Python tracker 

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



[issue8898] The email package should defer to the codecs module for all aliases

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is not newcomer friendly, I remove the easy keyword.

--
keywords:  -easy
nosy: +vstinner

___
Python tracker 

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



[issue968430] error flattening complex smime signed message

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is not newcomer friendly, I remove the easy keyword.

--
keywords:  -easy
nosy: +vstinner

___
Python tracker 

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



  1   2   >