[issue33345] Documentation for PowerShell instructions

2018-04-25 Thread Steve Piercy

Steve Piercy  added the comment:

After reviewing PowerShell syntax, I found it is impractical to support in 
Pyramid's documentation.  The discussion we had may be useful.

https://github.com/Pylons/pyramid/issues/3260

--

___
Python tracker 

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



[issue33351] Support compiling with clang-cl on Windows

2018-04-25 Thread Alex Walters

Alex Walters  added the comment:

Is this the same as the clang/llvm C1 that you can enable from inside Visual 
Studio?

--
nosy: +tritium

___
Python tracker 

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



[issue33305] Improve syntax error for numbers with leading zero

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

In Python 2.5 `0or[]` is valid syntax, but it is not valid in newer versions.

What is the good error message for this case?

--

___
Python tracker 

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



[issue33351] Support compiling with clang-cl on Windows

2018-04-25 Thread Ethan Smith

Ethan Smith  added the comment:

No, this is provided from llvm.org. You can find it as e.g. "Clang for Windows 
(64-bit)" here: http://releases.llvm.org/download.html#6.0.0

The Clang/C2 in Visual Studio is very different, and deprecated anyway.

--

___
Python tracker 

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



[issue33315] Allow queue.Queue to be used in type annotations

2018-04-25 Thread Ethan Smith

Change by Ethan Smith :


--
nosy: +Ethan Smith

___
Python tracker 

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



[issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library

2018-04-25 Thread Ethan Smith

Change by Ethan Smith :


--
nosy: +Ethan Smith

___
Python tracker 

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



[issue30465] FormattedValue expressions have wrong lineno and col_offset information

2018-04-25 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +6291

___
Python tracker 

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



[issue33351] Support compiling with clang-cl on Windows

2018-04-25 Thread Alex Walters

Alex Walters  added the comment:

When supporting platforms comes up, there's a usual list of questions, 
especially for windows.  I can remember two of them off the top of my head:

* Are you suggesting that CPython's build system move away from MSVC as the 
platform compiler for Windows?

* Are you able to provide a machine to run buildbots on?

--

___
Python tracker 

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



[issue22454] Adding the opposite function of shlex.split()

2018-04-25 Thread Matthijs Kooijman

Change by Matthijs Kooijman :


--
nosy: +Matthijs Kooijman

___
Python tracker 

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



[issue27645] Supporting native backup facility of SQLite

2018-04-25 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +6292

___
Python tracker 

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



[issue33041] Issues with "async for"

2018-04-25 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +6293

___
Python tracker 

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



[issue32710] test_asyncio leaked [4, 4, 3] memory blocks, sum=11 on AMD64 Windows8.1 Refleaks 3.x

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

The test is still leaking memory blocks. Any progress on investigating the 
issue?

--

___
Python tracker 

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



[issue32710] test_asyncio leaked [4, 4, 3] memory blocks, sum=11 on AMD64 Windows8.1 Refleaks 3.x

2018-04-25 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32706] test_check_hostname() of test_ftplib started to fail randomly

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

Christian Heimes: "Ned, I'm going to rewrite part of the test infrastructure 
during beta phase. (...)"

Any progress on rewriting these tests?

--

___
Python tracker 

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



[issue32652] test_distutils: BuildRpmTestCase tests fail on RHEL buildbots

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

test_distutils pass on s390x RHEL 3.x buildbot. I close 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



[issue33352] Windows: test_regrtest fails on installed Python

2018-04-25 Thread STINNER Victor

New submission from STINNER Victor :

Failure on Windows 10 with Python 3.7 beta 3:

==
ERROR: test_pcbuild_rt (test.test_regrtest.ProgramsTestCase)
--
Traceback (most recent call last):
  File 
"C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py",
 line 602, in test_pcbuild_rt
self.run_batch(script, *rt_args, *self.regrtest_args, *self.tests)
  File 
"C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py",
 line 577, in run_batch
proc = self.run_command(args)
  File 
"C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\test\test_regrtest.py",
 line 475, in run_command
**kw)
  File 
"C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", 
line 453, in run
with Popen(*popenargs, **kwargs) as process:
  File 
"C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", 
line 756, in __init__
restore_signals, start_new_session)
  File 
"C:\Users\vstinner\AppData\Local\Programs\Python\Python37\lib\subprocess.py", 
line 1155, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified


We may just skip the test if the script is not installed.

--
components: Tests, Windows
messages: 315730
nosy: paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: Windows: test_regrtest fails on installed Python
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



[issue31606] [Windows] Tests failing on installed Python 3.7a1 on Windows

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

> test_regrtest: "ERROR: test_pcbuild_rt (test.test_regrtest.ProgramsTestCase)" 
> because the tested script is not installed.

I created bpo-33352 for this one.

--

___
Python tracker 

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



[issue31606] [Windows] Tests failing on installed Python 3.7a1 on Windows

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

I tested Python 3.7 beta 3: test_marshal crashed and test_tools fails when 
running with python -m test -j2, but it seems like these two issues were 
already fixed in the 3.7 development branch.

I close this 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



[issue33353] test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD

2018-04-25 Thread STINNER Victor

New submission from STINNER Victor :

Example with a timeout of 10 seconds:

vstinner@freebsd$ ./python -m test -v test_asyncio -m 
test_sock_sendfile_mix_with_regular_send -v --timeout=10
== CPython 3.8.0a0 (heads/master:0977091dca, Apr 25 2018, 14:02:04) [Clang 
4.0.0 (tags/RELEASE_400/final 297347)]
== FreeBSD-11.1-RELEASE-amd64-64bit-ELF little-endian
== cwd: /usr/home/vstinner/prog/python/master/build/test_python_8317
== CPU count: 2
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 0.59 [1/1] test_asyncio
test_sock_sendfile_mix_with_regular_send 
(test.test_asyncio.test_events.KqueueEventLoopTests) ... Timeout (0:00:10)!
Thread 0x000801a16000 (most recent call first):
  File "/usr/home/vstinner/prog/python/master/Lib/asyncio/selector_events.py", 
line 456 in _sock_sendall
  File "/usr/home/vstinner/prog/python/master/Lib/asyncio/events.py", line 88 
in _run
  File "/usr/home/vstinner/prog/python/master/Lib/asyncio/base_events.py", line 
1738 in _run_once
  File "/usr/home/vstinner/prog/python/master/Lib/asyncio/base_events.py", line 
521 in run_forever
  File "/usr/home/vstinner/prog/python/master/Lib/asyncio/base_events.py", line 
553 in run_until_complete
  File 
"/usr/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_events.py", 
line 2117 in run_loop
  File 
"/usr/home/vstinner/prog/python/master/Lib/test/test_asyncio/test_events.py", 
line 2213 in test_sock_sendfile_mix_with_regular_send
  (...)

The test has been introduced in by the commit 
a19fb3c6aaa7632410d1d9dcb395d7101d124da4, bpo-32622.

The FreeBSD 3.7 and 3.x buildbots are broken, likely since this commit.

--
components: FreeBSD, asyncio
messages: 315733
nosy: asvetlov, koobs, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio: test_sock_sendfile_mix_with_regular_send() hangs on FreeBSD
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



[issue33354] Python2, FreeBSD: test_ssl fails on non-ASCII path

2018-04-25 Thread STINNER Victor

New submission from STINNER Victor :

The FreeBSD 2.7 buildbot is failing because of test_ssl:

test test_ssl failed -- Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/test/test_ssl.py", 
line 1005, in test_load_dh_params
shutil.copy(DHFILE, fname)
  File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/shutil.py", 
line 131, in copy
if os.path.isdir(dst):
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/genericpath.py", line 
49, in isdir
st = os.stat(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 
18: ordinal not in range(128)

==
ERROR: test_load_dh_params (test.test_ssl.ContextTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/test/test_ssl.py", 
line 1005, in test_load_dh_params
shutil.copy(DHFILE, fname)
  File "/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/shutil.py", 
line 131, in copy
if os.path.isdir(dst):
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd10/build/Lib/genericpath.py", line 
49, in isdir
st = os.stat(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 
18: ordinal not in range(128)


test.pythoninfo:

* os.cwd: /usr/home/buildbot/python/2.7.koobs-freebsd10/build
* sys.filesystem_encoding: US-ASCII


The failure is likely related to the commit 
6e8f395001b026daea047cf225dcca5a973ae824, bpo-25404:
---
commit 6e8f395001b026daea047cf225dcca5a973ae824
Author: Christian Heimes 
Date:   Sun Feb 25 09:48:02 2018 +0100

bpo-25404: SSLContext.load_dh_params() non-ASCII path (GH-3459)

SSLContext.load_dh_params() now supports non-ASCII path.

Signed-off-by: Christian Heimes 
---


Maybe the test should be skipped if the filesystem encoding cannot encode the 
path?

--
assignee: christian.heimes
components: FreeBSD, SSL
messages: 315734
nosy: christian.heimes, koobs, vstinner
priority: normal
severity: normal
status: open
title: Python2, FreeBSD: test_ssl fails on non-ASCII path
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



[issue33354] Python2: test_ssl fails on non-ASCII path

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

The issue is not specific to FreeBSD, it depends on the locale (on the Python 
filesystem encoding).

I reproduced the issue on Linux:

vstinner@apu$ LC_ALL=C ./python -m test test_ssl
Run tests sequentially
0:00:00 load avg: 0.27 [1/1] test_ssl
test test_ssl failed -- Traceback (most recent call last):
  File "/home/vstinner/prog/python/2.7/Lib/test/test_ssl.py", line 1005, in 
test_load_dh_params
shutil.copy(DHFILE, fname)
  File "/home/vstinner/prog/python/2.7/Lib/shutil.py", line 131, in copy
if os.path.isdir(dst):
  File "/home/vstinner/prog/python/2.7/Lib/genericpath.py", line 49, in isdir
st = os.stat(s)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 
18: ordinal not in range(128)

1 test failed:
test_ssl

Total duration: 1 sec
Tests result: FAILURE

--
components:  -FreeBSD
nosy:  -koobs
title: Python2, FreeBSD: test_ssl fails on non-ASCII path -> Python2: test_ssl 
fails on non-ASCII path

___
Python tracker 

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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-04-25 Thread STINNER Victor

New submission from STINNER Victor :

Windows10 3.x:

http://buildbot.python.org/all/#/builders/3/builds/817

Timeout (0:15:00)!
Thread 0x1e5c (most recent call first):
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_mmap.py", line 754 
in _make_test_file
  File "D:\buildarea\3.x.bolen-windows10\build\lib\test\test_mmap.py", line 769 
in test_large_filesize
  ...

--
components: Tests
messages: 315736
nosy: vstinner
priority: normal
severity: normal
status: open
title: Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()
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



[issue33356] Windows 10 buildbot: test__xxsubinterpreters.test_already_running() fails randomly

2018-04-25 Thread STINNER Victor

New submission from STINNER Victor :

Windows10 3.x: test_already_running() failed once, but passed when run again:

http://buildbot.python.org/all/#/builders/3/builds/817/steps/3/logs/stdio

==
FAIL: test_already_running (test.test__xxsubinterpreters.RunStringTests)
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.bolen-windows10\build\lib\test\test__xxsubinterpreters.py", 
line 561, in test_already_running
interpreters.run_string(self.id, 'print("spam")')
AssertionError: RuntimeError not raised

(...)
Re-running test 'test__xxsubinterpreters' in verbose mode
(...)
Ran 94 tests in 14.582s
OK (skipped=3)

--
components: Tests
messages: 315737
nosy: eric.snow, vstinner
priority: normal
severity: normal
status: open
title: Windows 10 buildbot: test__xxsubinterpreters.test_already_running() 
fails randomly
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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

The test also fails on Windows10 3.6 and Windows10 3.7.

--

___
Python tracker 

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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

Similar bug on AMD64 Windows8 3.x buildbot:

Timeout (0:15:00)!
Thread 0x1014 (most recent call first):
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_mmap.py", line 754 
in _make_test_file
  File "D:\buildarea\3.x.bolen-windows8\build\lib\test\test_mmap.py", line 764 
in test_large_offset

Same failure on AMD64 Windows8 3.6 and AMD64 Windows8 3.7.

--
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory

2018-04-25 Thread STINNER Victor

New submission from STINNER Victor :

vstinner@apu$ ./python -m test test_posix -R 3:3 -m 
test.test_posix.PosixTester.test_posix_spawn_file_actions
Run tests sequentially
0:00:00 load avg: 0.58 [1/1] test_posix
beginning 6 repetitions
123456
..
test_posix leaked [7, 7, 7] references, sum=21
test_posix leaked [1, 2, 1] memory blocks, sum=4
test_posix failed

1 test failed:
test_posix

Total duration: 315 ms
Tests result: FAILURE


I bet that the leak was introduced by:

commit 6c6ddf97c402709713d668d0ed53836a7749ba99
Author: Pablo Galindo 
Date:   Mon Jan 29 01:56:10 2018 +

bpo-20104: Expose `posix_spawn` in the os module (GH-5109)

Add os.posix_spawn to wrap the low level POSIX API of the same name.

Contributed by Pablo Galindo.

--

IMHO this issue is easy to fix, so I suggest to leave it to new contributors, 
or the author of the change.

--
components: Tests
messages: 315740
nosy: vstinner
priority: normal
severity: normal
status: open
title: [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory
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



[issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory

2018-04-25 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +pablogsal

___
Python tracker 

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



[issue33358] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails

2018-04-25 Thread STINNER Victor

New submission from STINNER Victor :

Re-running test 'test_embed' in verbose mode
test_bpo20891 (test.test_embed.EmbeddingTests) ... ok
test_forced_io_encoding (test.test_embed.EmbeddingTests) ... ok
test_pre_initialization_api (test.test_embed.EmbeddingTests) ... ok
test_pre_initialization_sys_options (test.test_embed.EmbeddingTests) ... --- 
['/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Programs/_testembed', 
'pre_initialization_sys_options'] failed ---
stdout:
stderr:
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Programs/_testembed: error while 
loading shared libraries: libpython3.8dm.so.1.0: cannot open shared object 
file: No such file or directory
--
FAIL
test_subinterps_different_ids (test.test_embed.EmbeddingTests) ... ok
test_subinterps_distinct_state (test.test_embed.EmbeddingTests) ... ok
test test_embed failed
test_subinterps_main (test.test_embed.EmbeddingTests) ... ok
==
FAIL: test_pre_initialization_sys_options (test.test_embed.EmbeddingTests)
--
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_embed.py", 
line 213, in test_pre_initialization_sys_options
"pre_initialization_sys_options", env=env)
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_embed.py", 
line 59, in run_embedded_interpreter
(p.returncode, err))
AssertionError: 127 != 0 : bad returncode 127, stderr is 
'/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Programs/_testembed: error 
while loading shared libraries: libpython3.8dm.so.1.0: cannot open shared 
object file: No such file or directory\n'
--
Ran 7 tests in 7.218s
FAILED (failures=1)
1 test failed again:
test_embed

--
components: Tests
messages: 315741
nosy: vstinner
priority: normal
severity: normal
status: open
title: x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() 
fails
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



[issue33281] ctypes.util.find_library not working on macOS

2018-04-25 Thread Michael Felt

Michael Felt  added the comment:

On 15/04/2018 07:56, Ned Deily wrote:
> Ned Deily  added the comment:
>
> Thanks for the report and the good detective work!  I see the same results.  
> It appears that the error was introduced by 
> c5ae169e1b73315672770517bf51cf8464286c76 for Issue26439.  It looks we need 
> both a fix and a test for this.  This really needs to be fixed for 3.7.0b4.

Perhaps he can give a bit more info. I do not understand how this could 
break things, as the darwin code is earlier in the queue.

if os.name == "posix" and sys.platform == "darwin":
     from ctypes.macholib.dyld import dyld_find as _dyld_find
     def find_library(name):
     possible = ['lib%s.dylib' % name,
     '%s.dylib' % name,
     '%s.framework/%s' % (name, name)]
     for name in possible:
     try:
     return _dyld_find(name)
     except ValueError:
     continue
     return None

if sys.platform.startswith("aix"):
     # AIX has two styles of storing shared libraries
     # GNU auto_tools refer to these as svr4 and aix
     # svr4 (System V Release 4) is a regular file, often with .so as suffix
     # AIX style uses an archive (suffix .a) with members (e.g., shr.o, 
libssl.so)
     # see issue#26439 and _aix.py for more details

     from ctypes._aix import find_library

elif os.name == "posix":
     # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
     import re, tempfile

     def _findLib_gcc(name):

As I understand the code above (and maybe I am wrong) - the code should 
be calling the unchanged routines in the macholib subdirectory. A simple 
test on macOS would be to comment out the two lines

if sys.platform.startswith("aix"):
     from ctypes._aix import find_library

That will "delete" the AIX find_library logic.

In other words - can someone check whether the unchanged 
Lib/ctypes/macholib/* files are being used? And if not, then something 
surprising is preventing that. If they are - no idea how the macholib 
code got effected by this. The goal was to have all changes in the 
_aix.py file, rather than in util.py.

>
> --
> nosy: +Michael.Felt, ned.deily, vstinner
> priority: normal -> release blocker
> stage:  -> needs patch
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory

2018-04-25 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

I think PR6332 is already addressing this 
https://github.com/python/cpython/pull/6332 , right?

--

___
Python tracker 

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



[issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory

2018-04-25 Thread STINNER Victor

STINNER Victor  added the comment:

I confirm that PR 6332 fixes the leak.

--

___
Python tracker 

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



[issue33357] [EASY C] test_posix.test_posix_spawn_file_actions() leaks memory

2018-04-25 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
superseder:  -> expose posix_spawn(p)

___
Python tracker 

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



[issue30613] Distutils register command creates non-standard multipart data

2018-04-25 Thread Kaeptm Blaubaer

Change by Kaeptm Blaubaer :


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

___
Python tracker 

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



[issue30613] Distutils register command creates non-standard multipart data

2018-04-25 Thread Éric Araujo

Éric Araujo  added the comment:

I think this is a duplicate, could you search existing bugs?

But given issue33071 , is this still relevant?

--

___
Python tracker 

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



[issue33258] Unable to install 3.6.5 on Windows Server 2008

2018-04-25 Thread Carl

Carl  added the comment:

The Windows server 2008 is in the process of being updated to 2012. Thanks for 
all the feedback

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



[issue30613] Distutils register command creates non-standard multipart data

2018-04-25 Thread Kaeptm Blaubaer

Kaeptm Blaubaer  added the comment:

Yes, I think it's relevant,

"not require register anymore, although other package indexes might"

This means other package indexes are required to be able to parse this HTTP. 
That's not good and has lead to workarounds (chishop for example= which might 
change the long-description in the body.
And it seems like the command hasn't changed since I developed the patch 
(around 10 months ago).

--

___
Python tracker 

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



[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-25 Thread Eryk Sun

Eryk Sun  added the comment:

As I said, some file systems such as NTFS and ISO 9660 (or Joliet) store 
directories in lexicographically sorted order. NTFS does this using a b-tree 
and case-insensitive comparison, which helps the driver efficiently implement 
filtering a directory listing using a pattern such as "spam*eggs?.txt". 
(Filtering of a directory listing at the syscall level is peculiar to Windows 
and not supported by Python.)

I like the phrase "arbitrary order". I don't think it's wise for an application 
to ever depend on the order. Also, we usually want natural-language collation 
for display purposes (e.g. spam2.txt should come before spam10.txt), so we have 
to sort the result regardless of the file system.

--

___
Python tracker 

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



[issue22069] TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline

2018-04-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-04-25 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +easy -patch
stage:  -> needs patch
versions: +Python 3.7, 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



[issue33351] Support compiling with clang-cl on Windows

2018-04-25 Thread Ethan Smith

Ethan Smith  added the comment:

>* Are you suggesting that CPython's build system move away from MSVC as the 
>platform compiler for Windows?

Not immediately, I don't think we should give up on the stability that 
currently exists with the cl based compilation. However, I think once CPython 
on clang-cl becomes stable, it will be compelling to switch. Clang-cl has the 
benefit of backwards compatibility with existing MSVC compiled c extensions, 
while generating a faster interpreter (perhaps 30% faster or more!).

* Are you able to provide a machine to run buildbots on?

I'm afraid not, I am just a college student :)

--

___
Python tracker 

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



[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 67a8f4fed3169e1b8c947c10f6e06863e399ae32 by Serhiy Storchaka 
(Andrés Delfino) in branch 'master':
bpo-33280: Reorganize external Tcl/Tk references. (GH-6473)
https://github.com/python/cpython/commit/67a8f4fed3169e1b8c947c10f6e06863e399ae32


--

___
Python tracker 

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



[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6295

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset e9d9494d6b2a5e0c2d48d22c7f0d5e95504b4f7e by Serhiy Storchaka in 
branch 'master':
bpo-0: Improve error handling in PyImport_Cleanup(). (GH-6564)
https://github.com/python/cpython/commit/e9d9494d6b2a5e0c2d48d22c7f0d5e95504b4f7e


--

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6296

___
Python tracker 

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



[issue33359] curses.has_key failure

2018-04-25 Thread Uzume

New submission from Uzume :

The following change is broken and should be reverted (for the one file anyway):

https://github.com/python/cpython/commit/6e3dbbdf39f3b4eb6f18c0165e446df17218b7dc#diff-c322497c7350a91fc1d78da0bb76b5b5

This does not seem to affect master but I did not check every Python version.

This causes the following broken behavior (as found on Python 2.7):
$ python -m curses.has_key
yields the exception
"TypeError: argument of type 'module' is not iterable"

--
components: Library (Lib)
messages: 315752
nosy: benjamin.peterson, uzume
priority: normal
severity: normal
status: open
title: curses.has_key failure
type: behavior
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



[issue33359] curses.has_key failure

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

python -m curses.has_key

--
keywords: +easy
nosy: +serhiy.storchaka
stage:  -> patch review

___
Python tracker 

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



[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-25 Thread Andrés Delfino

Change by Andrés Delfino :


--
pull_requests: +6297

___
Python tracker 

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



[issue33314] Bad rendering in the documentation for the os module

2018-04-25 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6298

___
Python tracker 

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



[issue33314] Bad rendering in the documentation for the os module

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 6a1799e6f02ef0db85d96d45d1f0a40ae72c9afe by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.7':
bpo-33314: Fix rendering issues in the documentation for the os module 
(GH-6525) (GH-6597)
https://github.com/python/cpython/commit/6a1799e6f02ef0db85d96d45d1f0a40ae72c9afe


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-25 Thread miss-islington

miss-islington  added the comment:


New changeset 53d36cc961ff2080fa91a216cce718295259d723 by Miss Islington (bot) 
in branch '3.7':
bpo-33280: Reorganize external Tcl/Tk references. (GH-6473)
https://github.com/python/cpython/commit/53d36cc961ff2080fa91a216cce718295259d723


--
nosy: +miss-islington

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread miss-islington

miss-islington  added the comment:


New changeset 291c9d4f74f3c7c57ae18e1aca617206795a090d by Miss Islington (bot) 
in branch '3.7':
bpo-0: Improve error handling in PyImport_Cleanup(). (GH-6564)
https://github.com/python/cpython/commit/291c9d4f74f3c7c57ae18e1aca617206795a090d


--
nosy: +miss-islington

___
Python tracker 

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



[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-25 Thread Andrés Delfino

Change by Andrés Delfino :


--
pull_requests: +6299

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6301

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6300

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6302

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 6606 replaces PyErr_Clear() with PyErr_WriteUnraisable(). This may add an 
unexpected noise at shutdown' but on other hand, this may be a helpful 
information in the case if something wrong happen. It doesn't produce 
additional output when run all tests, this means that that all is successful. I 
wonder in which circumstance that output will be occurred.

--

___
Python tracker 

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



[issue33334] Add support of NOP and EXTENDED_ARG in stack_effect()

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 57faf348872d1d0af1808c82f535cf220d64b028 by Serhiy Storchaka in 
branch 'master':
bpo-4: Support NOP and EXTENDED_ARG in dis.stack_effect(). (#6566)
https://github.com/python/cpython/commit/57faf348872d1d0af1808c82f535cf220d64b028


--

___
Python tracker 

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



[issue33334] Add support of NOP and EXTENDED_ARG in stack_effect()

2018-04-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue33280] Update link to Tcl/Tk 8.6 man pages in tkinter.rst

2018-04-25 Thread Andrés Delfino

Change by Andrés Delfino :


--
pull_requests: +6303

___
Python tracker 

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



[issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library

2018-04-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

[njs]
> "there's a bug in handling this python 2 code, so black won't be able to 
> reformat it until the next major python release"

Nah, we're still allowed to fix bugs in micro releases.  We should have more of 
those instead of sitting on fixed bugs for months.  That's a discussion for a 
different venue though.


[gutworth]
> The stdlib is a bad place for anything that needs to evolve at a non-glacial 
> place.

The syntax tree only needs to evolve to keep up with current Python 
development.  That's why I think it makes sense to tie the two.


[gvr]
> please consider seriously to move to a 3rd party package

Does that also invalidate the idea to merge the tokenizers?

And if so, does that also invalidate the idea to update lib2to3's tokenizer 
(BPO-8)?

--

___
Python tracker 

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



[issue33337] Provide a supported Concrete Syntax Tree implementation in the standard library

2018-04-25 Thread Guido van Rossum

Guido van Rossum  added the comment:

I think merging the tokenizers still makes sense. We can then document
top-level tokenize.py (in 3.8 and later) as guaranteed to be able to
tokenize anything going back to Python 2.7. And since lib2to3/pgen2 it is
undocumented I presume removing lib2to3/pgen2/tokenize.py isn't going to
break anything -- but if we worry about that it could be made into a
trivial wrapper for top-level tokenize.py.

Still, the improvements you're planning to lib2to3 (no matter how
compatible) will benefit more people sooner if you extract it into its own
PyPI package. Not everybody can upgrade to 3.7 as soon as Instagram. :-)

--

___
Python tracker 

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



[issue21822] KeyboardInterrupt during Thread.join hangs that Thread

2018-04-25 Thread Paul Goins

Paul Goins  added the comment:

I've confirmed this issue on Windows.  Attached is an SSCCE which seems to 
reliably reproduce the issue in a Windows environment.

Long story short: if a KeyboardInterrupt occurs during Thread.join(), there's a 
good chance that Thread._is_stopped never gets set.

--
nosy: +pdgoins
versions: +Python 3.6
Added file: 
https://bugs.python.org/file47549/sscce_thread_join_fails_on_keyboardinterrupt.py

___
Python tracker 

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



[issue21822] KeyboardInterrupt during Thread.join hangs that Thread

2018-04-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for the update.  Since I still can't reproduce on Linux, perhaps you (or 
one of our resident Windows experts) can try to propose a patch fixing the 
issue?

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue33360] ALternative recipe for password using secrets

2018-04-25 Thread Juan Postlbauer

New submission from Juan Postlbauer :

Chapter 15.3.4 shows a recipe with an infinite potential loop.
An alternative would be:

''.join(sorted([choice(string.ascii_lowercase) for i in 
range(1)]+[choice(string.ascii_uppercase) for i in 
range(1)]+[choice(string.digits) for i in 
range(3)]+[choice(string.ascii_letters+string.digits) for i in 
range(10-(1+1+3))],key=lambda x:randbelow(4096)))

Can we assume secrets.SystemRandom is cryptographically strong but has all the 
methods of random??
If so it can be done in a more understandable way by using choices and shuffle. 
(see 2 examples below)

def generate_password_random(totalchars=10,minlower=1,minupper=1,mindigits=3):
restcount= totalchars-(minlower+minupper+mindigits)
if restcount<0:
raise ValueError("Impossible conditions")
lowerchars=random.choices(string.ascii_lowercase,k=minlower)
upperchars=random.choices(string.ascii_uppercase,k=minupper)
digitchars=random.choices(string.digits,k=mindigits)
restchars=random.choices(string.ascii_letters+string.digits,k=restcount)
allchars=lowerchars+upperchars+digitchars+restchars
random.shuffle(allchars)
password=''.join(allchars)
return password

def generate_password_secrets(totalchars=10,minlower=1,minupper=1,mindigits=3):
restcount= totalchars- (minlower+minupper+mindigits)
if restcount<0:
raise ValueError("Impossible conditions")
lowerchars=[secrets.choice(string.ascii_lowercase) for _ in range(minlower)]
upperchars=[secrets.choice(string.ascii_uppercase) for _ in range(minupper)]
digitchars=[secrets.choice(string.digits) for _ in range (mindigits)]
restchars=[secrets.choice(string.ascii_letters+string.digits) for _ in 
range (restcount)]
allchars=lowerchars+upperchars+digitchars+restchars
allchars.sort(key=lambda x:secrets.randbelow(4096))
password=''.join(allchars)
return password

--
assignee: docs@python
components: Documentation
messages: 315763
nosy: docs@python, jpc4242
priority: normal
severity: normal
status: open
title: ALternative recipe for password using secrets
type: enhancement
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



[issue3692] improper scope in list comprehension, when used in class declaration

2018-04-25 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

I'm re-opening this, since the behavior sounds like a bug to me.

While I understand why it behaves the way it is now, but it seems wrong 
behavior. Perhaps we should look into finding a solution.

--
nosy: +Mariatta
resolution: wont fix -> 
status: closed -> open
versions: +Python 3.8 -Python 3.0

___
Python tracker 

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



[issue27485] urllib.splitport -- is it official or not?

2018-04-25 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 0250de48199552cdaed5a4fe44b3f9cdb5325363 by Łukasz Langa (Cheryl 
Sabella) in branch 'master':
bpo-27485: Rename and deprecate undocumented functions in urllib.parse (GH-2205)
https://github.com/python/cpython/commit/0250de48199552cdaed5a4fe44b3f9cdb5325363


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b16681fb1e63f45361d1d68333d6dbdd4bf5435d by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-0: Improve error handling in PyImport_Cleanup(). (GH-6564). 
(GH-6604)
https://github.com/python/cpython/commit/b16681fb1e63f45361d1d68333d6dbdd4bf5435d


--

___
Python tracker 

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



[issue33330] Better error handling in PyImport_Cleanup()

2018-04-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 55299fffe328c3d2dfc222a22116b7e53bf2e962 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-0: Improve error handling in PyImport_Cleanup(). (GH-6564). 
(GH-6605)
https://github.com/python/cpython/commit/55299fffe328c3d2dfc222a22116b7e53bf2e962


--

___
Python tracker 

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



[issue33361] readline() + seek() on io.EncodedFile breaks next readline()

2018-04-25 Thread Diego Argueta

New submission from Diego Argueta :

It appears that calling readline() on a codecs.EncodedFile stream breaks 
seeking and causes subsequent attempts to iterate over the lines or call 
readline() to backtrack and return already consumed lines.

A minimal example:

```
from __future__ import print_function

import codecs
import io


def run(stream):
offset = stream.tell()
try:
stream.seek(0)
header_row = stream.readline()
finally:
stream.seek(offset)

print('Got header: %r' % header_row)

if stream.tell() == 0:
print('Skipping the header: %r' % stream.readline())

for index, line in enumerate(stream, start=2):
print('Line %d: %r' % (index, line))


b = io.BytesIO(u'a,b\r\n"asdf","jkl;"\r\n'.encode('utf-16-le'))
s = codecs.EncodedFile(b, 'utf-8', 'utf-16-le')

run(s)
```

Output:

```
Got header: 'a,b\r\n'
Skipping the header: '"asdf","jkl;"\r\n'<-- this is line 2
Line 2: 'a,b\r\n'   <-- this is line 1
Line 3: '"asdf","jkl;"\r\n' <-- now we're back to line 2
```

As you can see, the line being skipped is actually the second line, and when we 
try reading from the stream again, the iterator starts from the beginning of 
the file.

Even weirder, adding a second call to readline() to skip the second line shows 
it's going **backwards**:

```
Got header: 'a,b\r\n'
Skipping the header: '"asdf","jkl;"\r\n'<-- this is actually line 2
Skipping the second line: 'a,b\r\n' <-- this is line 1
Line 2: '"asdf","jkl;"\r\n' <-- this is now correct
```

The expected output shows that we got a header, skipped it, and then read one 
data line.

```
Got header: 'a,b'
Skipping the header: 'a,b\r\n'
Line 2: '"asdf","jkl;"\r\n'
```

I'm sure this is related to the implementation of readline() because if we 
change this:

```
header_row = stream.readline()
```

to this:

```
header_row = stream.read().splitlines()[0]
```

then we get the expected output. If on the other hand we comment out the seek() 
in the finally clause, we also get the expected output (minus the "skipping the 
header") code.

--
components: IO, Library (Lib)
messages: 315768
nosy: da
priority: normal
severity: normal
status: open
title: readline() + seek() on io.EncodedFile breaks next readline()
type: behavior
versions: Python 2.7, Python 3.6

___
Python tracker 

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



[issue27485] urllib.splitport -- is it official or not?

2018-04-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks! This is now fixed for Python 3.8 \o/

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.8 -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue32209] Crash in set_traverse Within the Garbage Collector's collect_generations()

2018-04-25 Thread Connor W Fitzgerald

Change by Connor W Fitzgerald :


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



[issue32209] Crash in set_traverse Within the Garbage Collector's collect_generations()

2018-04-25 Thread Connor W Fitzgerald

Connor W Fitzgerald  added the comment:

I'm going to close this. It's been a really long time and this was for an 
assignment and I rewrote it before we put it into a github repo so I don't even 
have the buggy code still. Additionally I think it may have been the fault of 
some faulty memory I had in my computer so I'm betting that it wasn't pythons 
fault. Cheers.

--

___
Python tracker 

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



[issue33362] string strip() strips extra characters that it shouldn't

2018-04-25 Thread David Ghiurco

New submission from David Ghiurco :

No PR is attached since the issue is pretty trivial to reproduce but important 
nonetheless:

string = "LDA/AIC2/1919uc1b354363457"
print(string)
print(string.lstrip("LDA/"))

the stripped string should be "AIC2/1919uc1b354363457"
but is instead "IC2/1919uc1b354363457"

notice the leading "A" missing.

I've noticed this happens when the letter immediately following the slash is 
the same letter as the one immediately before the slash. Never contributed to 
python so I'm not exactly sure how to, but if anyone knowledgeable could take a 
look, this will probably be an easy fix.

Note: I am experiencing this on Python 3.6.4, specifically the Anaconda 
distribution. I have not tried another version.

--
messages: 315771
nosy: rahvan
priority: normal
severity: normal
status: open
title: string strip() strips extra characters that it shouldn't
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



[issue33362] string strip() strips extra characters that it shouldn't

2018-04-25 Thread pmpp

pmpp  added the comment:

lstrip(chars=None, /) method of builtins.str instance
Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.


all L D A / single chars get removed, while there is *any* of them of the left.
not the "LDA/" block as you probably expected

--
nosy: +pmpp

___
Python tracker 

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



[issue33362] string strip() strips extra characters that it shouldn't

2018-04-25 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

the argument to string.strip (also lstrip and rstrip) is not an exact substring 
to remove, but a set of characters to remove:

py> 'zyxzz1234'.strip('xyz')
'1234'

--
nosy: +steven.daprano
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



[issue33362] string strip() strips extra characters that it shouldn't

2018-04-25 Thread David Ghiurco

David Ghiurco  added the comment:

Thanks guys. I should have used .replace(). My bad.

--

___
Python tracker 

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



[issue33363] async for statement is not a syntax error in sync context

2018-04-25 Thread Zsolt Dollenstein

New submission from Zsolt Dollenstein :

Since 3.7, async generators can be used in non-async functions. The way this is 
implemented allows the following to be valid syntax:

def f():
async for i in aiterable:
pass
return 1

The return value of the above function is a Future that will never be done().

--
components: Interpreter Core
messages: 315775
nosy: zsol
priority: normal
severity: normal
status: open
title: async for statement is not a syntax error in sync context
type: behavior
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



[issue33363] async for statement is not a syntax error in sync context

2018-04-25 Thread Yury Selivanov

Yury Selivanov  added the comment:

Wow, this is a regression that has to be fixed in 3.7.

--
nosy: +ned.deily, yselivanov
priority: normal -> release blocker

___
Python tracker 

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



[issue33363] async for statement is not a syntax error in sync context

2018-04-25 Thread Nathaniel Smith

Change by Nathaniel Smith :


--
nosy: +njs
priority: release blocker -> normal

___
Python tracker 

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



[issue33363] async for statement is not a syntax error in sync context

2018-04-25 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Sorry, not sure why bpo decided to reset the priority there.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue33359] curses.has_key failure

2018-04-25 Thread Benjamin Peterson

Change by Benjamin Peterson :


--
keywords: +patch
pull_requests: +6304

___
Python tracker 

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



[issue33359] curses.has_key failure

2018-04-25 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 3219bbf6a159110d293dcfef2d5889ab020f4c5b by Benjamin Peterson in 
branch '2.7':
fix running the curses.has_key module (closes bpo-33359) (GH-6608)
https://github.com/python/cpython/commit/3219bbf6a159110d293dcfef2d5889ab020f4c5b


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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-04-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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