Re: indexed assignment in list

2018-07-11 Thread Peter Otten
Abdur-Rahmaan Janhangeer wrote:

> saw this snippet on the internet : why assigning by index propagates it
> all?

It doesn't.

> 
 a = [[1]] * 7
 a
> [[1], [1], [1], [1], [1], [1], [1]]
>  >>> a[0][0] = 2
 a
> [[2], [2], [2], [2], [2], [2], [2]]
> 
> why not
> 
> [[1], [2], [2], [2], [2], [2], [2]]

As to why you'd expect that one I've no idea.
 
> ?
> 
> thank you !

a = [[1]] * 7

creates a list containing seven references to the same inner list [1].

With seven distinct lists you get the expected

>>> a = [[1], [1], [1], [1], [1], [1], [1]]
>>> a[0][0] = 2
>>> a
[[2], [1], [1], [1], [1], [1], [1]]


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: indexed assignment in list

2018-07-11 Thread Peter Otten
Peter Otten wrote:

> a = [[1]] * 7
> 
> creates a list containing seven references to the same inner list [1].

I. e. it is roughly equivalent to

b = [1]
a = [b, b, b, b, b, b, b] 


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30774] list_repr not safe against concurrent mutation

2018-07-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Is it possible to reproduce this issue without involving signal handlers?

--

___
Python tracker 

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



[issue34083] Functional Programming HOWTO: Dictionary ordering isn't "essentially random"

2018-07-11 Thread Stig Johan Berggren


Change by Stig Johan Berggren :


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



indexed assignment in list

2018-07-11 Thread Abdur-Rahmaan Janhangeer
saw this snippet on the internet : why assigning by index propagates it all?

>>> a = [[1]] * 7
>>> a
[[1], [1], [1], [1], [1], [1], [1]]
 >>> a[0][0] = 2
>>> a
[[2], [2], [2], [2], [2], [2], [2]]

why not

[[1], [2], [2], [2], [2], [2], [2]]

?

thank you !
-- 
Abdur-Rahmaan Janhangeer
https://github.com/abdur-rahmaanj
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: indexed assignment in list

2018-07-11 Thread Abdur-Rahmaan Janhangeer
On Wed, Jul 11, 2018 at 10:55 AM Peter Otten <__pete...@web.de> wrote:

As to why you'd expect that one I've no idea


my mistake
-- 
Abdur-Rahmaan Janhangeer
https://github.com/abdur-rahmaanj
Mauritius
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27494] 2to3 parser failure caused by a comma after a generator expression

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31604] unittest.TestLoader().loadTestsFromTestCase(...) fails when adding test cases with the expectedFailure decorator

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue31297] Unpickleable ModuleImportError in unittest patch not backported to 2.7

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue21253] unittest assertSequenceEqual can lead to Difflib.compare() crashing on mostly different sequences

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior
versions: +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



[issue27494] 2to3 parser failure caused by a comma after a generator expression

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior
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



[issue25828] PyCode_Optimize() (peephole optimizer) doesn't handle KeyboardInterrupt correctly

2018-07-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Can this issue be closed now?

--

___
Python tracker 

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



[issue16360] argparse: comma in metavar causes assertion failure when formatting long usage message

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue12087] install_egg_info fails with UnicodeEncodeError depending on locale

2018-07-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Fixed in issue9561.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> distutils: set encoding to utf-8 for input and output files
type: crash -> behavior

___
Python tracker 

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



[issue24564] shutil.copytree fails when copying NFS to NFS

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Library (Lib)
type: crash -> behavior

___
Python tracker 

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



[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-07-11 Thread Christian Heimes


Christian Heimes  added the comment:

None of the hashlib functions are taking keyword arguments for data:

>>> hashlib.sha256(data=b'foo')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: openssl_sha256() takes no keyword arguments
>>> hashlib.blake2b(data=b'foo')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'data' is an invalid keyword argument for this function

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



[issue34033] distutils is not reproducible

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Is this issue for only known marshal issue?

IMHO the order in which .pyc files are created on disk also matters. It changes 
the result of "os.listdir()": some application can rely on unsorted 
os.listdir(). sorted() seems simple and hardless compared to the benefit.

--

___
Python tracker 

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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7781

___
Python tracker 

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



[issue33648] unused with_c_locale_warning option in configure should be removed

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset b91a3a0d61596cafb1b46c98fab65fee16a8 by INADA Naoki (Eitan 
Adler) in branch 'master':
bpo-33648: Remove PY_WARN_ON_C_LOCALE (GH-7114)
https://github.com/python/cpython/commit/b91a3a0d61596cafb1b46c98fab65fee16a8


--
nosy: +inada.naoki

___
Python tracker 

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



[issue25640] EmailMessage should throw an error if policy is set to compat32

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue24691] out of memory in distutils.upload with large files

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> resource usage

___
Python tracker 

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



[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue32729] socket error handling needed

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue33635] OSError when using pathlib.Path.rglob() to list device files

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue34084] possible free statically allocated string in compiler when easter egg on

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

> I expected it should be easy to reproduce a crash, but I failed to find an 
> example.

I don't understand how parsetok.c is supposed to handle "from __future__ import 
barry_as_FLUFL":

* Parser/parsetok.c tests (ps->p_flags & CO_FUTURE_BARRY_AS_BDFL)
* Python/future.c uses "if (strcmp(feature, FUTURE_BARRY_AS_BDFL) == 0) { 
ff->ff_features |= CO_FUTURE_BARRY_AS_BDFL; }"
* Python/pythonrun.c: PARSER_FLAGS() copies CO_FUTURE_BARRY_AS_BDFL flag as 
PyPARSE_BARRY_AS_BDFL

The only way to use "<>" operator seems to pass explicitly 
CO_FUTURE_BARRY_AS_BDFL flag to compile() flags, which is not the convenient 
way to use "from __future__ import barry_as_FLUFL" :-(

Code:
---
import inspect
CO_FUTURE_BARRY_AS_BDFL = 0x4
flags = CO_FUTURE_BARRY_AS_BDFL
code = "print(1 <> 2)"
try:
compile(code, "filename", "exec", flags=0)
except SyntaxError:
print("ok")
else:
raise Exception("SyntaxError expected")
compile(code, "filename", "exec", flags=flags)
print("ok")
---

Maybe we need a test for the easter egg. Or maybe we should remove it? :-p

--

___
Python tracker 

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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

bpo-14314 added a timeout of 5 seconds in the test:

-self.handled.wait()p
+self.handled.wait(5.0)  # 14314: don't wait forever

commit 17160fd6d6d7850294a9a465a3e5e399e5028bb6
Author: Vinay Sajip 
Date:   Thu Mar 15 12:02:08 2012 +

Fixes #14314: Improved SMTP timeout handling.


The timeout has been increased to 8 seconds by:

commit 827f5d35e592c21e4bb82afb702c6496cf77c2ad
Author: Vinay Sajip 
Date:   Tue Dec 3 11:28:55 2013 +

Issue #19665: Increased timeout for SMTPHandler test.


I suggest to just increase the timeout to 60 seconds.

--

___
Python tracker 

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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

Python 2.7 is not affected: it has no test for the SMTPHandler.

--
versions: +Python 3.6, Python 3.8

___
Python tracker 

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



[issue34083] Functional Programming HOWTO: Dictionary ordering isn't "essentially random"

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 5e5bbbec467a1569c914a048a94e7597528f92cf by INADA Naoki (Stig 
Johan Berggren) in branch 'master':
bpo-34083: Update dict order in Functional HOWTO (GH-8230)
https://github.com/python/cpython/commit/5e5bbbec467a1569c914a048a94e7597528f92cf


--
nosy: +inada.naoki

___
Python tracker 

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



[issue33597] Compact PyGC_Head

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-33597: Add What's New for PyGC_Head (GH-8236)

Thank you!

--

___
Python tracker 

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



[issue34091] REPL does not work in msys2, ConEmu terminals on windows

2018-07-11 Thread Maximilian Nöthe

Maximilian Nöthe  added the comment:

Tab completion does not work in the REPL even when started with `-i -u`, so 
there might be a deeper problem than just the PIPE that's preventing python 
from starting in interactive mode.

--

___
Python tracker 

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



[issue33648] unused with_c_locale_warning option in configure should be removed

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:

thanks

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



[issue23837] read pipe transport tries to resume reading after loop is gone

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue18323] 'GzipFile' object has no attribute 'extrastart'

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue23443] XMLRPCLIB Exception uses str not class or instance

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue31481] telnetlib fails to read continous large output from Windows Telnet Server

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue30566] punycode codec raises IndexError in decode_generalized_number()

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue33980] SSL Error when uploading package to your own pypi

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition)

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue33972] AttributeError in email.message.iter_attachments()

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue34084] possible free statically allocated string in compiler when easter egg on

2018-07-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Could you add a test in test_flufl.py that will fail with not patched code?

This issue and issue34080 look unrelated to me. They can be fixed independently.

--

___
Python tracker 

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



[issue17518] urllib2 cannnot handle https and BasicAuth via Proxy.

2018-07-11 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue19453] pydoc.py doesn't detect IronPython, help(foo) can hang

2018-07-11 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue34081] Sphinx duplicate label warning in docs

2018-07-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue33648] unused with_c_locale_warning option in configure should be removed

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

Should we backport the change to 3.7?

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



[issue18454] distutils crashes when uploading to PyPI having only the username (no pw) defined

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue23228] The tarfile module crashes when tarfile contains a symlink and unpack directory contain it too

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue26952] argparse help formatter crashes

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue33729] Hashlib/blake2* missing 'data' keyword argument

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue29442] Replace optparse with argparse in setup.py

2018-07-11 Thread INADA Naoki


Change by INADA Naoki :


--
nosy:  -inada.naoki
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue29442] Replace optparse with argparse in setup.py

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 09b2bece78f62c3d363236dce593ecfe130afd2f by INADA Naoki 
(Chih-Hsuan Yen) in branch 'master':
bpo-29442: Replace optparse with argparse in setup.py (GH-139)
https://github.com/python/cpython/commit/09b2bece78f62c3d363236dce593ecfe130afd2f


--
nosy: +inada.naoki

___
Python tracker 

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



[issue34091] REPL does not work in msys2, ConEmu terminals on windows

2018-07-11 Thread Maximilian Nöthe

New submission from Maximilian Nöthe :

The REPL won't start in interactive mode, it only starts when explicitly given 
the `-i` option. 

The problems IPython is having, e.g. missing syntax highlighting and no tab 
completion should have the same root.

See this issue for mingw:
https://github.com/Alexpux/MINGW-packages/issues/730

They fixed it by patching python using this patch:
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-python3/1700-cygpty-isatty.patch

And this issue at msys2:
https://sourceforge.net/p/msys2/tickets/32/

--
messages: 321417
nosy: maxnoe
priority: normal
severity: normal
status: open
title: REPL does not work in msys2, ConEmu terminals on windows
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34091] REPL does not work in msys2, ConEmu terminals on windows

2018-07-11 Thread Martin Panter

Martin Panter  added the comment:

The problem as I understand it is that Msys uses a pipe, but Python by default 
limits interactive REPL mode to terminals only. The same thing happens if you 
start Python on a pipe some other way, for instance “cat | python” vs “cat | 
python -i”.

I would prefer if Python decided to use interactive mode when no file name is 
given, rather than by checking if the file is a terminal. But that would break 
compatibility.

Another tip with Msys: enable unbuffered output with “python -u”. Otherwise 
output gets buffered, won’t be seen immediately, and may be lost if there is an 
unclean exit.

--
components: +Windows
nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread STINNER Victor

New submission from STINNER Victor :

https://buildbot.python.org/all/#builders/114/builds/163

1:26:51 load avg: 4.83 [117/415/1] test_logging failed -- running: 
test_multiprocessing_forkserver (8 min 18 sec)
beginning 6 repetitions
123456
.--- Logging error ---
Traceback (most recent call last):
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/smtplib.py", 
line 387, in getreply
line = self.file.readline(_MAXLINE + 1)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/socket.py", 
line 589, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/logging/handlers.py",
 line 1007, in emit
smtp = smtplib.SMTP(self.mailhost, port, timeout=self.timeout)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/smtplib.py", 
line 251, in __init__
(code, msg) = self.connect(host, port)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/smtplib.py", 
line 338, in connect
(code, msg) = self.getreply()
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/smtplib.py", 
line 391, in getreply
+ str(e))
smtplib.SMTPServerDisconnected: Connection unexpectedly closed: timed out
Call stack:
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/runpy.py", 
line 193, in _run_module_as_main
"__main__", mod_spec)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/runpy.py", 
line 85, in _run_code
exec(code, run_globals)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/regrtest.py",
 line 50, in 
_main()
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/regrtest.py",
 line 46, in _main
main()
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/main.py",
 line 584, in main
Regrtest().main(tests=tests, **kwargs)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/main.py",
 line 531, in main
self._main(tests, kwargs)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/main.py",
 line 547, in _main
run_tests_slave(self.ns.slaveargs)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest_mp.py",
 line 68, in run_tests_slave
result = runtest(ns, testname)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest.py",
 line 140, in runtest
result = runtest_inner(ns, test, display_failure=not ns.verbose)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest.py",
 line 177, in runtest_inner
refleak = dash_R(the_module, test, test_runner, ns.huntrleaks)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/refleak.py",
 line 69, in dash_R
indirect_test()
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/support/__init__.py",
 line 1606, in inner
return func(*args, **kwds)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/test_logging.py",
 line 4641, in test_main
support.run_unittest(*tests)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/support/__init__.py",
 line 1972, in run_unittest
_run_suite(suite)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/support/__init__.py",
 line 1882, in _run_suite
result = runner.run(suite)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/support/__init__.py",
 line 1781, in run
test(result)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 84, in __call__
return self.run(*args, **kwds)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 122, in run
test(result)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 84, in __call__
return self.run(*args, **kwds)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 122, in run
test(result)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/unittest/case.py",
 line 663, in __call__
return self.run(*args, **kwds)
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/unittest/case.py",
 line 615, in run
testMethod()
  File 
"/buildbot/buildarea/cpython/3.7.ware-gentoo-x86.refleak/build/Lib/test/test_logging.py",
 line 988, in test_basic
h.handle(r)
Message: 'Hello ✓'
Arguments: ()
test test_logging failed -- Traceback (most recent call last):
  File 

[issue29442] Replace optparse with argparse in setup.py

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

> bpo-29442: Replace optparse with argparse in setup.py (GH-139)

I'm surprised that it works, but I tested manually and I confirm that it works 
:-)

$ git clean -fdx
$ ./configure --with-pydebug
$ make
$ ./python -c "import select"

No compilation error ;-)

--

___
Python tracker 

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



[issue23837] asyncio: read pipe transport tries to resume reading after loop is gone

2018-07-11 Thread STINNER Victor


Change by STINNER Victor :


--
title: read pipe transport tries to resume reading after loop is gone -> 
asyncio: read pipe transport tries to resume reading after loop is gone

___
Python tracker 

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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 31b50b8cbfbf49d5fc17c612cf0dfaa4d0c24983 by Victor Stinner in 
branch 'master':
bpo-34092, test_logging: increase SMTPHandlerTest timeout (GH-8245)
https://github.com/python/cpython/commit/31b50b8cbfbf49d5fc17c612cf0dfaa4d0c24983


--

___
Python tracker 

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



[issue34093] Reproducible pyc: FLAG_REF is not stable.

2018-07-11 Thread INADA Naoki


Change by INADA Naoki :


--
components: Extension Modules
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Reproducible pyc: FLAG_REF is not stable.
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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7778

___
Python tracker 

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



[issue34093] Reproducible pyc: FLAG_REF is not stable.

2018-07-11 Thread INADA Naoki


New submission from INADA Naoki :

PR-8226 makes marshal two-pass.  It may have small overhead.

In case of compiling module, marshal performance is negligible.
But how in other cases?  Should this change optional?

And should we backport this to Python 3.7?
Or should distributors cherrypick this?

--
stage: patch review -> 

___
Python tracker 

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



[issue25828] PyCode_Optimize() (peephole optimizer) doesn't handle KeyboardInterrupt correctly

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

Yeah, let's close this issue.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue10523] argparse has problem parsing option files containing empty rows

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue21567] cannot create multipart alternative message with us-ascii charset

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue22496] urllib2 fails against IIS (urllib2 can't parse 401 reply www-authenticate headers)

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue27513] email.utils.getaddresses does not handle Header objects

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue27820] Possible bug in smtplib when initial_response_ok=False

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue33808] ssl.get_server_certificate fails with openssl 1.1.0 but works with 1.0.2g for self-signed certificate

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue34071] repr(task) raises AssertionError for coros which loop.create_task accepts; complications ensue

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue31377] remove *_INTERNED opcodes from marshal

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:

I doubt that interning cause reproduciblity problem.

AFAIK, all strings in code object are interned or not
interned deterministically.

https://bugzilla.opensuse.org/show_bug.cgi?id=1049186
This issue seems be caused by w_ref() based on object refcnt,
not interning.

--

___
Python tracker 

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



[issue33597] Compact PyGC_Head

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset d5c875bbf1ef9b24349d3243b1ffaab6a9d5a78e by INADA Naoki in branch 
'master':
bpo-33597: Add What's New for PyGC_Head (GH-8236)
https://github.com/python/cpython/commit/d5c875bbf1ef9b24349d3243b1ffaab6a9d5a78e


--

___
Python tracker 

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



[issue34083] Functional Programming HOWTO: Dictionary ordering isn't "essentially random"

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:

Thanks, Stig.
And I'm sorry about I missed Raymond assigned himself.

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



[issue34084] possible free statically allocated string in compiler when easter egg on

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Could you add a test in test_flufl.py that will fail with not patched code?

It seems like PyObject_FREE() is never called with the static string "with 
Barry as BDFL, use '<>' instead of '!='".

When parsetok() goes to code path (1):

err_ret->text = "with Barry as BDFL, use '<>' "
"instead of '!='";

Later, it goes to code path (2) as well:

if (tok->buf != NULL) {
...
err_ret->text = (char *) PyObject_MALLOC(len + 1);

Hum, I modified my PR to removed *dead code*:

err_ret->text = "with Barry as BDFL, use '<>' "
"instead of '!='";

> This issue and issue34080 look unrelated to me. They can be fixed 
> independently.

In practice, both issues are related and it seems easier to me to fix them both 
at the same time ;-)

--

___
Python tracker 

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



[issue34093] Reproducible pyc: FLAG_REF is not stable.

2018-07-11 Thread INADA Naoki


Change by INADA Naoki :


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

___
Python tracker 

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



[issue34033] distutils is not reproducible

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:

OK, I created sub issue for pyc.

--
dependencies: +Reproducible pyc: FLAG_REF is not stable., remove *_INTERNED 
opcodes from marshal

___
Python tracker 

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



[issue34091] REPL does not work in msys2, ConEmu terminals on windows

2018-07-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d68cb9d62c3671dd9aee5cdecb02fcb3268dacf0 by Victor Stinner in 
branch '3.6':
bpo-34092, test_logging: increase SMTPHandlerTest timeout (GH-8245) (GH-8249)
https://github.com/python/cpython/commit/d68cb9d62c3671dd9aee5cdecb02fcb3268dacf0


--

___
Python tracker 

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



[issue33648] unused with_c_locale_warning option in configure should be removed

2018-07-11 Thread INADA Naoki


INADA Naoki  added the comment:

Hm, it seems safe to backport.

--

___
Python tracker 

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



[issue33648] unused with_c_locale_warning option in configure should be removed

2018-07-11 Thread INADA Naoki


Change by INADA Naoki :


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



[issue19453] pydoc.py doesn't detect IronPython, help(foo) can hang

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue17518] urllib2 cannnot handle https and BasicAuth via Proxy.

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue23389] pkgutil.find_loader raises an ImportError on PEP 420 implicit namespace packages

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue26543] imaplib noop Debug

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue29516] shutil.copytree(symlinks=True) fails when copying symlinks cross-device and there is no alternative

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue27715] call-matcher breaks if a method is mocked with spec=True

2018-07-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: crash -> behavior

___
Python tracker 

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



[issue34084] possible free statically allocated string in compiler when easter egg on

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is related to bpo-34080.

--

___
Python tracker 

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



[issue34080] Memory leak in the compiler in case of errors

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

Related issue: bpo-34084.

--

___
Python tracker 

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



[issue34080] Memory leak in the compiler in case of errors

2018-07-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7774

___
Python tracker 

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



[issue34084] possible free statically allocated string in compiler when easter egg on

2018-07-11 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue34084] possible free statically allocated string in compiler when easter egg on

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, this easter egg is tested by Lib/test/test_flufl.py.

--

___
Python tracker 

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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue34083] Functional Programming HOWTO: Dictionary ordering isn't "essentially random"

2018-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +

___
Python tracker 

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



[issue34094] Porting Python 2 to Python 3 example contradicts its own advice

2018-07-11 Thread Bruce Richardson


New submission from Bruce Richardson :

https://docs.python.org/3/howto/pyporting.html#use-feature-detection-instead-of-version-detection

In this section, the (very good) advice is "It would be better to treat Python 
2 as the exceptional case instead of Python 3 and assume that future Python 
versions will be more compatible with Python 3 than Python 2"

However, it then goes on to present the best solution (for dealing with library 
imports) is this:

try:
from importlib import abc
except ImportError:
from importlib2 import abc

This is literally treating Python 3 as the exception, completely contradicting 
the advice given a few lines earlier.  Practically, it also has the effect 
that, as Python 3 adoption spreads, import errors and automatic retries will 
become *more* common and then universal, adding a small amount of delay and 
noise to the entire Python estate.  And that's not considering the case where 
both libraries are installed to cope with old code relying on the old library 
(in which case you surely want new code to default to using the new library)

If the example is simply changed to

try:
from importlib2 import abc
except ImportError:
from importlib import abc

then both the contradiction and the practical problems go away

--
assignee: docs@python
components: Documentation
messages: 321436
nosy: Bruce Richardson, brett.cannon, docs@python
priority: normal
severity: normal
status: open
title: Porting Python 2 to Python 3 example contradicts its own advice

___
Python tracker 

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



[issue34092] test_logging: SMTPHandlerTest.test_basic() fails randomly on x86 Gentoo Refleaks 3.7

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

I hope that the issue was just that the buildbot was slow, and that the failure 
didn't hide a real bug.

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



[issue33648] unused with_c_locale_warning option in configure should be removed

2018-07-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7782

___
Python tracker 

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



[issue34087] django: segmentation fault on garbage collection in visit_decref()

2018-07-11 Thread STINNER Victor


Change by STINNER Victor :


--
title: Segmentation fault on visit_decref -> django: segmentation fault on 
garbage collection in visit_decref()

___
Python tracker 

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



[issue32729] socket.readinto() doesn't catch TimeoutError

2018-07-11 Thread STINNER Victor


STINNER Victor  added the comment:

According to the reporter, it's not a bug in Python.

--
nosy: +vstinner
resolution: fixed -> 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



[issue34075] asyncio: We should prohibit setting a ProcessPoolExecutor in with set_default_executor

2018-07-11 Thread STINNER Victor


Change by STINNER Victor :


--
title: We should prohibit setting a ProcessPoolExecutor in with 
set_default_executor -> asyncio: We should prohibit setting a 
ProcessPoolExecutor in with set_default_executor

___
Python tracker 

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



  1   2   3   >