[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is not cp1252

2019-05-02 Thread Paul Monson


Paul Monson  added the comment:

==
FAIL: test_startup_imports (test.test_site.StartupImportTests)
--
Traceback (most recent call last):
  File "c:\docker\pythond\lib\test\test_site.py", line 542, in 
test_startup_imports
self.assertFalse(modules.intersection(collection_mods), stderr)
AssertionError: {'operator', 'keyword', 'functools', 'heapq', 'collections', 
'reprlib'} is not false : import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # 
import '_warnings' # 
import '_weakref' # 
import '_frozen_importlib_external' # 
import '_io' # 
import 'marshal' # 
import 'nt' # 
import _thread # previously loaded ('_thread')
import '_thread' # 
import _weakref # previously loaded ('_weakref')
import '_weakref' # 
import 'winreg' # 
# installing zipimport hook
import 'time' # 
import 'zipimport' # 
# installed zipimport hook
# c:\docker\pythond\lib\encodings\__pycache__\__init__.cpython-38.pyc matches 
c:\docker\pythond\lib\encodings\__init__.py
# code object from 
'c:\\docker\\pythond\\lib\\encodings\\__pycache__\\__init__.cpython-38.pyc'
# c:\docker\pythond\lib\__pycache__\codecs.cpython-38.pyc matches 
c:\docker\pythond\lib\codecs.py
# code object from 
'c:\\docker\\pythond\\lib\\__pycache__\\codecs.cpython-38.pyc'
import '_codecs' # 
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 
0x01D9DBD0>
# c:\docker\pythond\lib\encodings\__pycache__\aliases.cpython-38.pyc matches 
c:\docker\pythond\lib\encodings\aliases.py
# code object from 
'c:\\docker\\pythond\\lib\\encodings\\__pycache__\\aliases.cpython-38.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader 
object at 0x01EFF900>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 
0x01D9DA50>
# c:\docker\pythond\lib\encodings\__pycache__\utf_8.cpython-38.pyc matches 
c:\docker\pythond\lib\encodings\utf_8.py
# code object from 
'c:\\docker\\pythond\\lib\\encodings\\__pycache__\\utf_8.cpython-38.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object 
at 0x01D9DCC0>
import '_signal' # 
# c:\docker\pythond\lib\encodings\__pycache__\cp65001.cpython-38.pyc matches 
c:\docker\pythond\lib\encodings\cp65001.py
# code object from 
'c:\\docker\\pythond\\lib\\encodings\\__pycache__\\cp65001.cpython-38.pyc'
# c:\docker\pythond\lib\__pycache__\functools.cpython-38.pyc matches 
c:\docker\pythond\lib\functools.py
# code object from 
'c:\\docker\\pythond\\lib\\__pycache__\\functools.cpython-38.pyc'
# c:\docker\pythond\lib\__pycache__\abc.cpython-38.pyc matches 
c:\docker\pythond\lib\abc.py
# code object from 'c:\\docker\\pythond\\lib\\__pycache__\\abc.cpython-38.pyc'
import '_abc' # 
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 
0x01F16FC0>
# c:\docker\pythond\lib\collections\__pycache__\__init__.cpython-38.pyc matches 
c:\docker\pythond\lib\collections\__init__.py
# code object from 
'c:\\docker\\pythond\\lib\\collections\\__pycache__\\__init__.cpython-38.pyc'
# c:\docker\pythond\lib\__pycache__\_collections_abc.cpython-38.pyc matches 
c:\docker\pythond\lib\_collections_abc.py
# code object from 
'c:\\docker\\pythond\\lib\\__pycache__\\_collections_abc.cpython-38.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object 
at 0x01F423C0>
# c:\docker\pythond\lib\__pycache__\operator.cpython-38.pyc matches 
c:\docker\pythond\lib\operator.py
# code object from 
'c:\\docker\\pythond\\lib\\__pycache__\\operator.cpython-38.pyc'
import '_operator' # 
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 
0x01F4D630>
# c:\docker\pythond\lib\__pycache__\keyword.cpython-38.pyc matches 
c:\docker\pythond\lib\keyword.py
# code object from 
'c:\\docker\\pythond\\lib\\__pycache__\\keyword.cpython-38.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 
0x01F58810>
# c:\docker\pythond\lib\__pycache__\heapq.cpython-38.pyc matches 
c:\docker\pythond\lib\heapq.py
# code object from 'c:\\docker\\pythond\\lib\\__pycache__\\heapq.cpython-38.pyc'
import '_heapq' # 
import 'heapq' # <_frozen_importlib_external.SourceFileLoader object at 
0x01F588D0>
import 'itertools' # 
# c:\docker\pythond\lib\__pycache__\reprlib.cpython-38.pyc matches 
c:\docker\pythond\lib\reprlib.py
# code object from 
'c:\\docker\\pythond\\lib\\__pycache__\\reprlib.cpython-38.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 
0x01F59900>
import '_collections' # 
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 
0x01F25810>
import '_functools' # 
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 
0x01EFFCC0>
import 'encodings.cp65001' # <_frozen_importlib_external.SourceFileLoader 
object at 0x01EFF9F0>
# c:\docker\pythond\lib\encodings\__pycache__\latin_1.cpython-38.pyc matches 

[issue36772] Let lru_cache be used as a decorator with no arguments

2019-05-02 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is not cp1252

2019-05-02 Thread Inada Naoki


Inada Naoki  added the comment:

Could you paste how the test fails?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-02 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

Well, at least we're not alone.  Here's a screen capture from Mail.app Version 
12.4 (3445.104.8).

--
Added file: https://bugs.python.org/file48295/Screen Shot 2019-05-02 at 
22.07.27.png

___
Python tracker 

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



[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-05-02 Thread daniel hahler


daniel hahler  added the comment:

I seems like http.cookiejar should be used for clients, which includes more 
relaxed parsing of cookies.  This is mentioned in the docs at 
https://github.com/python/cpython/blame/443fe5a52a3d6a101795380227ced38b4b5e0a8b/Doc/library/http.cookies.rst#L63-L65.

--

___
Python tracker 

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



[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-02 Thread Windson Yang


Windson Yang  added the comment:

I found the issue located in 
https://github.com/python/cpython/blob/master/Lib/email/_parseaddr.py#L277

elif self.field[self.pos] in '.@':
# email address is just an addrspec
# this isn't very efficient since we start over
self.pos = oldpos
self.commentlist = oldcl
addrspec = self.getaddrspec()
returnlist = [(SPACE.join(self.commentlist), addrspec)]

The parseaddr function runs a for in loop over the input string, when it meets 
'.@' it will do something. That is why when the input string is 
'f...@bar.com@example.com' will return ('', 'f...@bar.com'). One possible 
solution will be to check the string in the reverse order then we can always 
get the last '@' in the string.

--
nosy: +Windson Yang

___
Python tracker 

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



[issue36772] Let lru_cache be used as a decorator with no arguments

2019-05-02 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

At Pycon today, I mostly got all positive feedback on this.  Apparently py.test 
already follows this pattern.  Another developer said they found the () to be 
distracting and would welcome not having to use them.

--

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is not cp1252

2019-05-02 Thread Paul Monson


Change by Paul Monson :


--
pull_requests: +12988

___
Python tracker 

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



[issue36779] time.tzname returns empty string on Windows if default codepage is a Unicode codepage

2019-05-02 Thread Paul Monson


Change by Paul Monson :


--
title: strptime returns empty string on Windows if default codepage is a 
Unicode codepage -> time.tzname returns empty string on Windows if default 
codepage is a Unicode codepage

___
Python tracker 

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



[issue36779] strptime returns empty string on Windows if default codepage is a Unicode codepage

2019-05-02 Thread Paul Monson


New submission from Paul Monson :

Need to work around a CRT bug in the use of _tzset() + _tzname[] 
Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 
results in empty strings in _tzname[].
This causes time.tzname to be an empty string.
I have reported the bug.

One possible workaround is to temporarily change the locale by calling 
setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale 
after if the GetACP() == CP_UTF8 or CP_UTF7

--
messages: 341318
nosy: Paul Monson
priority: normal
severity: normal
status: open
title: strptime returns empty string on Windows if default codepage is a 
Unicode codepage

___
Python tracker 

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



[issue35070] test_posix fails on macOS 10.14 Mojave

2019-05-02 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


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

___
Python tracker 

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



[issue36699] building for riscv multilib (patch attached)

2019-05-02 Thread Andreas K . Hüttel

Andreas K. Hüttel  added the comment:

Who am I to disagree.

--
resolution:  -> third party
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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is not cp1252

2019-05-02 Thread Paul Monson


Change by Paul Monson :


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

___
Python tracker 

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



[issue36778] test_site.StartupImportTests.test_startup_imports fails if default code page is not cp1252

2019-05-02 Thread Paul Monson


New submission from Paul Monson :

Windows desktop skus have a default ANSI codepage (returned by GetACP()) of 
1252 (Western European).  Windows IoT Core and Windows Nano Server have a 
default codepage of 65001 (UTF-8). 

This causes test_site.StartupImportTests.test_startup_imports to fail on 
Windows IoT Core and Windows Nano Server because cp65001.py is loaded instead 
of the frozen cp1252.py at startup.

I tried changing the default codepage to 65001 on my dev machine and rebuilding 
Python and it had no effect that I could tell on the generated frozen 
importlibs.

The simplest solutions would be for the test_startup_imports test to be skipped 
or changed to pass when the locale.getpreferredencoding() returns 'cp65001'

--
components: Tests, Windows
messages: 341316
nosy: Paul Monson, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: test_site.StartupImportTests.test_startup_imports fails if default code 
page is not cp1252
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue13611] Integrate ElementC14N module into xml.etree package

2019-05-02 Thread Stefan Behnel


Stefan Behnel  added the comment:

> Maybe complete Doc/license.rst?

Thanks, done.

--

___
Python tracker 

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



[issue36775] Rework filesystem codec implementation

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:

I updated my PEP 587:
[Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 2nd version
https://mail.python.org/pipermail/python-dev/2019-May/157290.html

--

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Paul Moore


Paul Moore  added the comment:

> So the question is: how do you get repr by default, but allow the format spec?
>
> The only thing I've come up with is:
> - f"{expr!d}" expands to f"expr={repr(expr)}", but
> - f"{expr!d:spec} expands to f"expr={format(expr, spec)}"
>
> I think this is the most useful version. But is it too complex to explain?

Agreed, this is the most useful version. Not only do I not think it's
too complicated to explain, I actually think it's the obvious
behaviour, and what people would expect even without an explanation.

If asked, I'd explain it as:

f"{expr!d:spec}" expands to "expr=". If ":spec" is omitted, repr() is used.

That seems simple enough to me - the key is that we're just saying "if
:spec is omitted, we use repr".

--

___
Python tracker 

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



[issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly.

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12985

___
Python tracker 

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



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

2019-05-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 304ca211c4912f040151e518d9d66fd2d625c5e9 by Terry Jan Reedy in 
branch '3.7':
 [3.7] bpo-34162: Fix idlelib/NEWS.text for 3.7.4  (#13067)
https://github.com/python/cpython/commit/304ca211c4912f040151e518d9d66fd2d625c5e9


--

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4631da1242fc96002a3c0462a87d087e567368aa by Victor Stinner in 
branch 'master':
bpo-36763: Remove _PyCoreConfig._init_main (GH-13066)
https://github.com/python/cpython/commit/4631da1242fc96002a3c0462a87d087e567368aa


--

___
Python tracker 

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



[issue14546] lll.py can't handle multiple parameters correctly

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Carton He for the bug report, thanks Zackery Spytz for the fix, thanks 
Serhiy Storchaka for the review ;-)

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



[issue14546] lll.py can't handle multiple parameters correctly

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7c2c01f02a1821298a62dd16ecc3a12da663e14b by Victor Stinner 
(Zackery Spytz) in branch '2.7':
[2.7] bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026) 
(GH-13063)
https://github.com/python/cpython/commit/7c2c01f02a1821298a62dd16ecc3a12da663e14b


--

___
Python tracker 

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



[issue14546] lll.py can't handle multiple parameters correctly

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e85ba1e69288e3fce400ed4cdbefab58934b5904 by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
[3.7] bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026) 
(GH-13060)
https://github.com/python/cpython/commit/e85ba1e69288e3fce400ed4cdbefab58934b5904


--

___
Python tracker 

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



[issue36776] test_tools: test_lll_multiple_dirs() failed on AMD64 Windows7 SP1 3.x

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 70005ac0fddd8585725b92acd1bc2b8e7b81999c by Victor Stinner in 
branch 'master':
bpo-36763: _PyCoreConfig_SetPyArgv() preinitializes Python (GH-13037)
https://github.com/python/cpython/commit/70005ac0fddd8585725b92acd1bc2b8e7b81999c


--

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

Re: format specs and what they apply to.

The problem is that you want f"{expr!d}" to expand to f"expr={repr(expr)}". And 
I think you want that because it's the most useful behavior for strings. 
Without the repr it's not very useful for strings.

But you want to have the format spec apply to the expression, not the repr of 
the expression. So maybe f"{expr!d:spec}" should expand to 
f"expr={repr(format(expr, spec))}"

So
f"{datetime.now()!d:%Y-%m-%d}"
would become:
f"datetime.now()={repr(format(datetime.now(), '%Y-%m-%d'))}"
but that gives:
"datetime.now()='2019-05-02'"

Do we want the repr of the resulting string here (the single quotes around 
2019-05-02)? I think probably no (think float formatting).

So the question is: how do you get repr by default, but allow the format spec?

The only thing I've come up with is:
- f"{expr!d}" expands to f"expr={repr(expr)}", but
- f"{expr!d:spec} expands to f"expr={format(expr, spec)}"

I think this is the most useful version. But is it too complex to explain?

--

___
Python tracker 

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



[issue36710] Pass _PyRuntimeState as an argument rather than using the _PyRuntime global variable

2019-05-02 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I think there are two questions to answer.  First, do we want to support 
multiple runtimes per process?  Second, if we do, what is the best way to do 
that?  Some people would argue that multiple runtimes are not needed or are too 
hard to do.  Maybe they are correct, I'm not sure.  We should try to get a 
consensus on that first question.

If we do decide to do it, then we need to answer the second question.  Passing 
a "context" argument around seems the best solution.  That is how the Java JNI 
does it.  It sounds like that's how Javascript VMs do it too.  We don't need to 
get creative.  Look at what other VMs do and copy the best idea.

If we do decide to do it, evolving the codebase and all extension modules is 
going to be a massive task.  I would imagine that we can have a backwards 
compatible API layer that uses TSS.  The layer that passes context explicitly 
would still have to maintain the TSS.  There could be a build option that turns 
that backwards compatibility on or off.  If off, you would gain some 
performance advantage because TSS does not have to be kept up-to-date.

My feeling right now that even though this is a massive job, it is the correct 
thing to do.  CPUs continue to gain cores.  Improving CPython's ability to do 
multi-threading and multi-processing should be a priority for CPython core 
developers.

--
nosy: +nascheme

___
Python tracker 

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



[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst


Aaron Hurst  added the comment:

Hi Ned,

Thanks for testing this.  I also observe that macOS compiles "without error"... 
but it's still broken... and silently.

This is because the pyexpat line isn't being turned into the expected set of 
source compilation rules, but it is instead being dumped into the variable 
definition section.  Why is it being interpreted by makesetup as a variable 
definition?  With the equals character, it matches this pattern:

# Lines can also have the form
#
#  = 
#
# which defines a Make variable definition inserted into Makefile.in

But it is intended to match this pattern:

# Lines have the following structure:
#
#  ... [ ...] [ ...] [ ...]

For reference, here is the corresponding rule in makesetup:

> *=*)DEFS="$line$NL$DEFS"; continue;;

I fully support tweaking this pattern to better differentiate when "=" means a 
variable definition and when "=" is part of a compilation flag, but given that 
pyexpat is the only such case, my one-line fix makes things consistent again.  
For now.

--

___
Python tracker 

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



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

2019-05-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

PR 12579 started as a fixup for 3.7.4, but there seemed to be a problem of 
duplicate commits.  The fix, based on Ned Deily's comments, after fetching from 
upstream:

cd ../37  # 3.7 workspace
git branch -D news37  # and dict37, whatever it was
git reset --hard  784f52a^

git merge upstream/37

git push --force origin

Then git checkout -b news37 to add dates and fix for 3.7.4 to produce PR 13067

--

___
Python tracker 

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



[issue36775] Rework filesystem codec implementation

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 709d23dee69e700b87d5a4cb59e149d0e1af7993 by Victor Stinner in 
branch 'master':
bpo-36775: _PyCoreConfig only uses wchar_t* (GH-13062)
https://github.com/python/cpython/commit/709d23dee69e700b87d5a4cb59e149d0e1af7993


--

___
Python tracker 

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



[issue36776] test_tools: test_lll_multiple_dirs() failed on AMD64 Windows7 SP1 3.x

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6ae2bbbdfcb8969d1d362b17c2fbd5a684fa4f9d by Victor Stinner 
(Zackery Spytz) in branch 'master':
bpo-36776: Add @support.skip_unless_symlink to test_lll.py (GH-13058)
https://github.com/python/cpython/commit/6ae2bbbdfcb8969d1d362b17c2fbd5a684fa4f9d


--

___
Python tracker 

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



[issue36776] test_tools: test_lll_multiple_dirs() failed on AMD64 Windows7 SP1 3.x

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:

Another failure:
https://buildbot.python.org/all/#builders/58/builds/2317
Python on x86 Windows7 3.x

--

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 373893ce51b0eaf0dec901e36a3e4217fbed3e32 by Victor Stinner in 
branch 'master':
bpo-36763: Add _PyCoreConfig._config_version (GH-13065)
https://github.com/python/cpython/commit/373893ce51b0eaf0dec901e36a3e4217fbed3e32


--

___
Python tracker 

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



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

2019-05-02 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +12984

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12983

___
Python tracker 

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



[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the updates, Aaron.  The plot thickens!  If I perform the steps on a 
current macOS system, the result is:

273 pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c 
-I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY=1 
-DUSE_PYEXPAT_CAPI

which works just fine.  So it seems the underlying problem is actually a 
difference in the behavior of the makesetup shell script, most likely some 
difference in one of the utilities it uses, like sed, perhaps a BSD vs GNU 
difference.

I won't have more time to look into this further today but feel free to do so 
if you like.  In any case, we should fix the root problem in makesetup rather 
than trying to work around it elsewhere.

--

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Paul Moore


Paul Moore  added the comment:

+1 from me. It's something I'd find useful, and it's a natural extension of the 
f-string syntax.

> I can't decide if I'm going to allow a format specifier.

The only useful interpretation IMO would be for {expr!d:fmt} to expand to 
expr={expr:fmt}. If you're not willing to include that in the initial 
implementation, I'd rather see :fmt reserved for now, with the intention that 
it's implemented like this at a later date. Having :fmt apply to the whole 
string including the "expr=" bit would be basically useless to me. For a 
motivating example, consider f"{datetime.now()!d:%Y-%m-%d}", which is something 
I could easily imagine using.

Steven D'Aprano:
> I think there are enough use-cases for having access to
> expressions, complete with source code, as first-class
> values to make this a general feature of the language
> and not baked into f-strings. I have a proto-PEP
> discussing this.

I have no problem with something like this, but I don't think it precludes the 
proposed f-string extension. The use cases are sufficiently different that I'd 
expect the two features to live happily together - there's no need to block the 
f-string extension for a proposal like this.

--
nosy: +paul.moore

___
Python tracker 

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



[issue36716] Embedded Python fails to import module files with version_platform extensions

2019-05-02 Thread Eric Cosatto


Eric Cosatto  added the comment:

I'm closing the issue, see my previous post.

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



[issue36716] Embedded Python fails to import module files with version_platform extensions

2019-05-02 Thread Eric Cosatto


Eric Cosatto  added the comment:

Problem solved:

Running the following code in the CommandLine Python and in the C++ embedded 
python clarified the problem:

  import importlib.machinery
  print(importlib.machinery.all_suffixes())
  
CommandLine Python:
> ['.py', '.pyw', '.pyc', '.cp37-win_amd64.pyd', '.pyd']

C++ Embedded Python:
> ['.py', '.pyw', '.pyc', '_d.cp37-win_amd64.pyd', '_d.pyd']

It shows that the Embedded python is running in Debug mode and therefore adds a 
_d to the suffix. Yet the numpy or pytorch installed only non-debug files.

--

___
Python tracker 

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



[issue36763] PEP 587: Rework initialization API to prepare second version of the PEP

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12982

___
Python tracker 

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



[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-02 Thread Ned Deily


Ned Deily  added the comment:

@barry, @r.david.murray, With the additional info about attacks in the wild, 
should we now consider this a security issue?  If so, someone needs to provide 
an actual PR.  (Raising the priority to "deferred blocker" pending evaluation.)

--
nosy: +ned.deily
priority: normal -> deferred blocker

___
Python tracker 

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



[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst


Aaron Hurst  added the comment:

Hi Ned,

>From a fresh checkout of master on Ubuntu 18.04, I uncomment the pyexpat line 
>in Modules/Setup and run:

cpython$ ./configure
...
cpython$ make
Makefile:273: *** missing separator.  Stop.

Here is the offending section of the resulting Makefile:

269 # === Definitions added by makesetup ===
270 
271 LOCALMODLIBS=  
272 BASEMODLIBS=
273 pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c 
-I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_$
274 PYTHONPATH=$(COREPYTHONPATH)
275 COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)

--

___
Python tracker 

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



[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst


Aaron Hurst  added the comment:

Sorry for my misunderstanding of the process, and thanks for explaining.  I 
resubmitted the PR against the master branch.

--

___
Python tracker 

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



[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Aaron Hurst


Change by Aaron Hurst :


--
pull_requests: +12981

___
Python tracker 

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



[issue36772] Let lru_cache be used as a decorator with no arguments

2019-05-02 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +dino.viehland, eric.snow, giampaolo.rodola, njs

___
Python tracker 

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



[issue14546] lll.py can't handle multiple parameters correctly

2019-05-02 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +12980

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> One thing to note though is that they claim URLs with spaces embedded in them 
> are apparently somewhat common in the world, we might want to relax our check 
> to not include space (\x20) in the rejected characters for that reason.

Guess I missed it in the PR discussion and read your comment [0] now about the 
change from golang's fix that excluded space as a problematic character. Is it 
worth documenting this change somewhere like a versionchanged directive in 
http.client?

[0] https://github.com/python/cpython/pull/12755#discussion_r279888496

Thanks for the details.

--

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

A note from the urllib3 fixes to this:  They chose to go the route of 
auto-%-encoding the offending characters in URLs instead.  I do not think the 
stdlib should do this.

One thing to note though is that they claim URLs with spaces embedded in them 
are apparently somewhat common in the world, we might want to relax our check 
to not include space (\x20) in the rejected characters for that reason.

A space alone cannot be used for injection.  Someone could append an incorrect 
HTTP protocol version to a request using it " HTTP/1.0" but that would be 
followed by the actual " HTTP/x.y" generated by our library which at that point 
is up to the server to parse and or reject as odd.  Without the ability to 
inject \r\n the headers to go with the protocol cannot be modified; so a change 
in protocol version could at most alter how some headers may be treated.  Worst 
case: they upgrade/downgrade the http version in a non-pedantic server - i 
believe this to be low impact (feel free to prove me wrong with a working 
example against a common server).  Best case: The server rejects the 
unparseable request or considers their " HTTP/1.0" to be part of their URL path.

In a world where unescaped spaces in URLs are common, some servers _might_ 
already take the strategy of splitting only on the first and last spaces in the 
request line anyways, considering everything in the middle to be the url with 
embedded spaces.

--

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

regarding issue28307 - It is not always correct to convert a %d %u %i used to 
render v into f'{int(v)}'.  That'd lose the TypeError when v is not an integer.

If you are looking at making internal private conversions for the purposes of 
that issue, I think they should be things that'll never conflict with a normal 
public API token that might be used in the future. (ie: don't reserve 'd' 'i' 
or 'f' for internal only use - use special values)  i'm being vague on purpose 
here as i don't know how f-strings are parsed and tokenized.

--

___
Python tracker 

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



[issue35726] QueueHandler formatting affects other handlers

2019-05-02 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue35726] QueueHandler formatting affects other handlers

2019-05-02 Thread Ned Deily


Ned Deily  added the comment:


New changeset 3f8f64ebf3ab05038ed0b5a4adc83d0a5e9fbb82 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659) 
(GH-13061)
https://github.com/python/cpython/commit/3f8f64ebf3ab05038ed0b5a4adc83d0a5e9fbb82


--

___
Python tracker 

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



[issue36775] Rework filesystem codec implementation

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12979

___
Python tracker 

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



[issue35726] QueueHandler formatting affects other handlers

2019-05-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12978

___
Python tracker 

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



[issue35726] QueueHandler formatting affects other handlers

2019-05-02 Thread Ned Deily


Ned Deily  added the comment:


New changeset 386b6f07a9703746590a5f29281b93c931c0e6d3 by Ned Deily (Xtreak) in 
branch '3.7':
[3.7] bpo-35726: Prevented QueueHandler formatting from affecting other 
handlers (GH-11537) (GH-12716)
https://github.com/python/cpython/commit/386b6f07a9703746590a5f29281b93c931c0e6d3


--
nosy: +ned.deily

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-05-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

IMO it does qualify as a security issue. In case of urllib to be lenient and 
can be exploited it's good to document like tarfile and xml modules that have a 
warning about untrusted data potentially causing issues and perhaps link to a 
url validator that adheres to RFC in pypi. I would expect stdlib to handle this 
but in case it's not handled due to backwards compatibility and potential 
regressions a warning could be made about the same in the docs noting down the 
responsibility of the functions and that they are not always safe against 
malicious data.

--

___
Python tracker 

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



[issue36777] unittest discover throws TypeError on empty packages

2019-05-02 Thread Karthikeyan Singaravelan

New submission from Karthikeyan Singaravelan :

In the given folder structure unittest discover fails. I think this is due to 
issue32303 where __file__ was set as None and I guess empty packages didn't 
have __file__ set before which has None value now. Hence the_module.__file__ 
returns None and thus subsequent calls to os.path.dirname raise TypeError. 
There is one another location in the same file in unittest module causing this 
issue. See also issue36406 for similar error in doctest with the change. I 
reverted bbbcf8693b876daae4469765aa62f8924f39a7d2 just to confirm the issue. I 
am adding devs in issue32303 and unittest. Any thoughts on this would be 
helpful.

➜  cpython git:(master) ✗ tree test1
test1
└── test2
└── test_foo.py

1 directory, 1 file
➜  cpython git:(master) ✗ ./python.exe -m unittest discover test1.test2
Traceback (most recent call last):
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/runpy.py", line 
192, in _run_module_as_main
return _run_code(code, main_globals, None,
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/runpy.py", line 
85, in _run_code
exec(code, run_globals)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/__main__.py", 
line 18, in 
main(module=None)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/main.py", 
line 100, in __init__
self.parseArgs(argv)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/main.py", 
line 124, in parseArgs
self._do_discovery(argv[2:])
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/main.py", 
line 244, in _do_discovery
self.createTests(from_discovery=True, Loader=Loader)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/main.py", 
line 154, in createTests
self.test = loader.discover(self.start, self.pattern, self.top)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/loader.py", 
line 306, in discover
os.path.dirname((the_module.__file__)))
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/posixpath.py", 
line 152, in dirname
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

# 3.6.4 works that doesn't have the change

➜  cpython git:(master) ✗ python3.6 -m unittest discover test1.test2
.
--
Ran 1 test in 0.000s

OK


A unittest would be as below : 

def test_empty_package_discovery(self):
# bpo-36789: Return zero test cases when using discovery in
# empty packages.

with support.temp_dir() as path:
dirname, basename = os.path.split(path)
os.mkdir(os.path.join(path, 'test2'))

with support.DirsOnSysPath(dirname):
loader = unittest.TestLoader()
empty_package = f"{basename}.test2"
tests_count = loader.discover(empty_package).countTestCases()
self.assertEqual(loader.discover(empty_package).countTestCases(), 0)


One possible fix would be to check for __file__ == None and return empty list 
of test cases but this causes a behavior change like below where my patch 
returns 0 and python 3.6 returns 1 test.

# Patch

diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py
index ba7105e1ad..f465b2419f 100644
--- a/Lib/unittest/loader.py
+++ b/Lib/unittest/loader.py
@@ -302,6 +302,10 @@ class TestLoader(object):
 the_module = sys.modules[start_dir]
 top_part = start_dir.split('.')[0]
 try:
+filepath = the_module.__file__
+# __file__ is None for empty packages. Hence return empty 
list of tests.
+if filepath == None:
+return self.suiteClass([])
 start_dir = os.path.abspath(
os.path.dirname((the_module.__file__)))
 except AttributeError:

# Behavior change

➜  cpython git:(unittest-empty-package) ✗ ./python.exe -m unittest discover 
test1.test2

--
Ran 0 tests in 0.000s

OK
➜  cpython git:(unittest-empty-package) ✗ python3.6 -m unittest discover 
test1.test2
.
--
Ran 1 test in 0.000s

OK

My patch also causes reference leak and I am not sure why. So I guess mine is 
not the best approach to solving this.

➜  cpython git:(unittest-empty-package) ✗ ./python.exe -m test 
--fail-env-changed -R 3:3 test_unittest
Run tests sequentially
0:00:00 load avg: 1.46 [1/1] test_unittest
beginning 6 repetitions
123456
..
test_unittest leaked [99, 99, 99] references, sum=297
test_unittest leaked [38, 38, 38] memory blocks, sum=114
test_unittest failed in 43 sec 634 ms

== Tests result: FAILURE ==

1 test failed:
test_unittest

Total duration: 43 sec 655 ms
Tests result: FAILURE

--
components: Library (Lib)

[issue36694] Excessive memory use or memory fragmentation when unpickling many small objects

2019-05-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Great work Inada-san! Thank you for your investigations!

PR 13036 increases the chance of using borrowed references during pickling. 
Since this bug exists in the current code too (it just can be exposed in 
smaller number of cases), it should be fixed in any case. So I going to fix 
this bug before merging PR 13036, and fix it in a way that does not prevent the 
optimization.

--

___
Python tracker 

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



[issue14546] lll.py can't handle multiple parameters correctly

2019-05-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12977

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

To implement converting printf-style string formatting into f-string 
expressions (see issue28307) I need to add new convertors:

'd': int(x) where x is a number, used for %d, %u, %i
'i': operator.index(i), used for %x, %o, %b
'f': float(x) where x is a number, used for %f, %g, %e

They may be private, only exposed in the AST between optimizer and code 
generator. But they can also be supported by Python grammar and str.format() if 
there is a use case for this.

If 'd' be used for other purposes, I will need to find other character for 
converting a number to integer (with possible truncation). Any suggestions?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36742] urlsplit doesn't accept a NFKD hostname with a port number

2019-05-02 Thread Ned Deily


Ned Deily  added the comment:


New changeset e5f9f4adb95233c66578e6f7ea176687af2f78ca by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
bpo-36742: Fixes handling of pre-normalization characters in urlsplit() 
(GH-13017) (GH-13024)
https://github.com/python/cpython/commit/e5f9f4adb95233c66578e6f7ea176687af2f78ca


--

___
Python tracker 

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



[issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop

2019-05-02 Thread Ned Deily


Change by Ned Deily :


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



[issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop

2019-05-02 Thread Ned Deily


Ned Deily  added the comment:


New changeset dadc3478950c389c120fb16f44e5a29cc43f by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687) 
(GH-12910)
https://github.com/python/cpython/commit/dadc3478950c389c120fb16f44e5a29cc43f


--
nosy: +ned.deily

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Eric V. Smith


Change by Eric V. Smith :


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

___
Python tracker 

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



[issue36775] Rework filesystem codec implementation

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 43fc3bb7cf0278735eb0010d7b3043775a120cb5 by Victor Stinner in 
branch 'master':
bpo-36775: Add _PyUnicode_InitEncodings() (GH-13057)
https://github.com/python/cpython/commit/43fc3bb7cf0278735eb0010d7b3043775a120cb5


--

___
Python tracker 

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



[issue35184] Makefile is not correctly generated when compiling pyextat with DXML_POOR_ENTROPY=1

2019-05-02 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report and thanks for the PR.  I am confused here as I cannot 
reproduce the failure.  Can someone show what is invalid in the Makefile?  
Also, if the change really does need to be made to Setup.dist (3.7) or Setup 
(master -> 3.8), then setup.py should likely be changed to reduce future 
confusion (although it presumably doesn't make a difference to the compile).  
Further, please submit PRs like this against the master branch (unless the 
problem only exists in a specific released branches); fixes are normally 
applied to the master branch and the core developer handling the merge will 
elect to backport to appropriate branches as needed.

--
nosy: +ned.deily
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue36776] test_tools: test_lll_multiple_dirs() failed on AMD64 Windows7 SP1 3.x

2019-05-02 Thread Zackery Spytz


Zackery Spytz  added the comment:

I'm sorry. I have submitted a fix.

--

___
Python tracker 

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



[issue36776] test_tools: test_lll_multiple_dirs() failed on AMD64 Windows7 SP1 3.x

2019-05-02 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue36775] Rework filesystem codec implementation

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12974

___
Python tracker 

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



[issue36775] Rework filesystem codec implementation

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e251095a3f4778102f554cecffcfd837f4d1db6c by Victor Stinner in 
branch 'master':
bpo-36775: Add _Py_FORCE_UTF8_FS_ENCODING macro (GH-13056)
https://github.com/python/cpython/commit/e251095a3f4778102f554cecffcfd837f4d1db6c


--

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

!d sounds good and makes teaching easier. Adding additional symbol sort of 
clutters the experience in f'{name!!}'. I think it will be a good thing to have 
it in 3.8 since it serves one of the common things in debugging f'name = 
{name}' and perhaps it could be expanded out of f-strings after feedback.

Rust also introduced similar feature with 
https://doc.rust-lang.org/beta/std/macro.dbg.html and received very positive 
feedback . This will be a very exciting thing to look forward in 3.8 :)

--

___
Python tracker 

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



[issue14546] lll.py can't handle multiple parameters correctly

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:

> test_tools: test_lll_multiple_dirs() failed on  AMD64 Windows7 SP1 3.x: see 
> bpo-36776.

I guess that the test should be decorated by @support.skip_unless_symlink or 
something like that.

--

___
Python tracker 

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



[issue36776] test_tools: test_lll_multiple_dirs() failed on AMD64 Windows7 SP1 3.x

2019-05-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +ZackerySpytz, serhiy.storchaka

___
Python tracker 

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



[issue14546] lll.py can't handle multiple parameters correctly

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:

test_tools: test_lll_multiple_dirs() failed on  AMD64 Windows7 SP1 3.x: see 
bpo-36776.

--
nosy: +vstinner

___
Python tracker 

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



[issue36776] test_tools: test_lll_multiple_dirs() failed on AMD64 Windows7 SP1 3.x

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:

New test added by bpo-14546.

--

___
Python tracker 

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



[issue36776] test_tools: test_lll_multiple_dirs() failed on AMD64 Windows7 SP1 3.x

2019-05-02 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 Windows7 SP1 3.x:
https://buildbot.python.org/all/#/builders/40/builds/2106

ERROR: test_lll_multiple_dirs (test.test_tools.test_lll.lllTests)
--
Traceback (most recent call last):
  File 
"C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_tools\test_lll.py", 
line 24, in test_lll_multiple_dirs
os.symlink(fn, os.path.join(dir, 'symlink'))
OSError: [WinError 1314] A required privilege is not held by the client: 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmp1wogs146\\foo1' -> 
'C:\\Users\\Buildbot\\AppData\\Local\\Temp\\tmp1wogs146\\symlink'

The function failed twice.

--
components: Tests
messages: 341272
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_tools: test_lll_multiple_dirs() failed on  AMD64 Windows7 SP1 3.x
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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

hallway conversation with Eric: neither of us have immediately good thoughts on 
a spelling other than !d for this.  !! or != seem esoteric and/or unparseable, 
using a capital letter like !D could be new and odd and might be useful to 
differentiate types of debug output (!d vs !D, etc) so lets not start with 
caps.  thus I'm not suggesting any alternative bikeshed color.

--

___
Python tracker 

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



[issue36775] Rework filesystem codec implementation

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Steven:  We shouldn't block this immediately useful feature from going in for 
f-strings on waiting for some much broader first class access to expressions 
feature.  !d would be practical today.

--

___
Python tracker 

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



[issue14546] lll.py can't handle multiple parameters correctly

2019-05-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c4e78b116f9a4299f3b3bfbbd18ef49782bb1143 by Serhiy Storchaka 
(Zackery Spytz) in branch 'master':
bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026)
https://github.com/python/cpython/commit/c4e78b116f9a4299f3b3bfbbd18ef49782bb1143


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

for reference, the discourse thread: 
https://discuss.python.org/t/f-string-debug-conversion/99/14

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue36775] Rework filesystem codec implementation

2019-05-02 Thread STINNER Victor


New submission from STINNER Victor :

I would like to add callbacks in PyInterpreterState for the filesystem encoding 
to avoid parsing the encoding name at each encode/decode call 
(PyUnicode_EncodeFSDefault, PyUnicode_DecodeFSDefault).

--
components: Interpreter Core
messages: 341267
nosy: vstinner
priority: normal
severity: normal
status: open
title: Rework filesystem codec implementation
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



[issue13611] Integrate ElementC14N module into xml.etree package

2019-05-02 Thread Stefan Behnel


Change by Stefan Behnel :


--
pull_requests: +12972

___
Python tracker 

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



[issue36772] Let lru_cache be used as a decorator with no arguments

2019-05-02 Thread Stefan Behnel


Stefan Behnel  added the comment:

I'm generally ok with such APIs. It seems needless to require

  @lru_cache()
  def f(): ...

when a simple decorator would suffice. I think I might decide otherwise in 
cases where almost all usages require arguments, but if the no-arguments case 
is common (and there is no ambiguity in the arguments), then I prefer not 
requiring parentheses.

--
nosy: +scoder

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Andy Dirnberger


Change by Andy Dirnberger :


--
nosy: +dirn

___
Python tracker 

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



[issue36773] Race condition during pickle.load()

2019-05-02 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

This could be a duplicate of Issue34572

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue36260] Zip Bomb vulnerability

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


--
title: Cpython/Lib vulnerability found and request a patch submission -> Zip 
Bomb vulnerability

___
Python tracker 

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



[issue13611] Integrate ElementC14N module into xml.etree package

2019-05-02 Thread STINNER Victor


STINNER Victor  added the comment:

> Is there anything else I have to take care of when adding externally 
> provided/licensed files to the source tree?

Maybe complete Doc/license.rst?
https://docs.python.org/dev/license.html

--

___
Python tracker 

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



[issue1191964] add non-blocking read and write methods to subprocess.Popen

2019-05-02 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> out of date

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

I support a general mechanism. But I think that if it's much more than the 2 
characters that this would take, then I don't want to use it for f-strings. The 
whole point here (as with all f-string features) is a concise way to get the 
string you're after.

But if you have some ideas, I'm willing to entertain them. I want this feature 
to land in 3.8, for which we're rapidly running out of time.

--

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Thu, May 02, 2019 at 11:40:45AM +, Eric V. Smith wrote:
> 
> New submission from Eric V. Smith :
> 
> I originally propsed this here: 
> https://mail.python.org/pipermail/python-ideas/2018-October/053956.html, and 
> there has also been some discussion on discourse.
> 
> The proposal is to add a !d "type conversion" to f-strings, to make for 
> simpler "print-based debugging". The idea is that !d would be like !r, etc., 
> except that the resulting string would be:
> 
> - the text of the expression, followed by
> - an equal sign, followed by
> - the value of the expression

I don't want to see this added as a special case to f-strings. I think 
there are enough use-cases for having access to expressions, complete 
with source code, as first-class values to make this a general feature 
of the language and not baked into f-strings. I have a proto-PEP 
discussing this.

> I have a patch almost ready.

Please don't limit this useful feature to f-strings. "Debugging strings" 
only scratches the surface of what this could be useful for.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue36774] f-strings: Add a !d conversion for ease of debugging

2019-05-02 Thread Eric V. Smith


New submission from Eric V. Smith :

I originally propsed this here: 
https://mail.python.org/pipermail/python-ideas/2018-October/053956.html, and 
there has also been some discussion on discourse.

The proposal is to add a !d "type conversion" to f-strings, to make for simpler 
"print-based debugging". The idea is that !d would be like !r, etc., except 
that the resulting string would be:

- the text of the expression, followed by
- an equal sign, followed by
- the value of the expression

So this code:
s = 'A string'
result = f'{s!d}'

Would set result to 's="A string"'.

Note that the text of the expression is exactly what's between the
opening brace and the !. So:
result = f'{s !d}'

Would set result to 's ="A string"'. Note the space before the equal sign.

I can't decide if I'm going to allow a format specifier. If I do, it would 
apply to the entire resulting string. So:
result = f'{s!d:*^20}'

Would set result to 's="A string"'.

But I might reserve format specs for further use, perhaps to apply to the value 
of the expression instead of the resulting string.

Of course this is of most value for more complex expressions. This:
v = 3
result = f'{v*9+15!d}'

Would set result to 'v*9+15=42'.

I'd expect this mostly to be used with print() or logging, but it's a general 
f-string feature.

I have a patch almost ready.

--
assignee: eric.smith
components: Interpreter Core
messages: 341261
nosy: eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: f-strings: Add a !d conversion for ease of debugging
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue36773] Race condition during pickle.load()

2019-05-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pitrou

___
Python tracker 

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



[issue13611] Integrate ElementC14N module into xml.etree package

2019-05-02 Thread Stefan Behnel


Stefan Behnel  added the comment:

A buildbot failure made me notice that the test files were not part of the 
CPython installation yet, so I added them. I also took the opportunity to add a 
README file that describes where they come from and under which conditions they 
were originally provided by the W3C (IANAL, but basically free use with 
copyright notice).

https://www.w3.org/Consortium/Legal/2015/doc-license

Is there anything else I have to take care of when adding externally 
provided/licensed files to the source tree?

--

___
Python tracker 

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



[issue13611] Integrate ElementC14N module into xml.etree package

2019-05-02 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset 0d5864fa07ab4f03188c690a5eb07bdd1fd1cb9c by Stefan Behnel in 
branch 'master':
bpo-13611: Include C14N 2.0 test data in installation (GH-13053)
https://github.com/python/cpython/commit/0d5864fa07ab4f03188c690a5eb07bdd1fd1cb9c


--

___
Python tracker 

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



[issue25707] Add the close method for ElementTree.iterparse() object

2019-05-02 Thread Stefan Behnel


Stefan Behnel  added the comment:

Ok, I think it's reasonable to make the resource management explicit for the 
specific case of letting iterparse() open the file. That suggests that there 
should also be context manager support, given that safe usages would often 
involve a try-finally.

Since it might not always be obvious for users when they need to close the 
iterator or not, I would also suggest to not let it raise an error on a 
double-close, i.e. if .close() was already called or the iterator was already 
exhausted (and the file closed automatically), calling .close() should just do 
nothing.

--

___
Python tracker 

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



[issue36773] Race condition during pickle.load()

2019-05-02 Thread papad


New submission from papad :

There seems to be a race condition when unpickling the same object from 
different threads (My guess is it's related to imports that are related to the 
unpickled object). 

I have used the following files for reproduction (File contents are in the 
attached archive, also pasted at the bottom of the issue report):
import_me.py - Containing the object we will pickle
pickle_object.py - the code to pickle the object
trigger.py - a piece of code to unpickle the object from different threads 
simultaneously and trigger the crash

I have used the files in the attached archive (containing the 3 files mentioned 
above)

to reproduce run the following commands:

pickle_object.py
trigger.py

Running trigger.py will crash on about 50% of the runs with the following error:

Traceback (most recent call last):
  File "./trigger.py", line 16, in pickle_load_thread
pickle.load(h)
AttributeError: Can't get attribute 'PickleMe' on 


I have tested this on the following software stacks:

1. python:3.7.3 docker
- linux version: 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 
2019 x86_64 GNU/Linux
- python: 3.7.3
- distro: Debian GNU/Linux 9 (stretch)

2. my laptop
- linux version: 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 
2019 x86_64 x86_64 x86_64 GNU/Linux
- python: 3.6.7
- distro: Ubuntu 18.04.2 LTS


I'm uncertain if this is a bug related to pickle or python module importing.
Similar issues I've found: https://bugs.python.org/issue12680 and 
https://bugs.python.org/issue30891.


---
filename: import_me.py
#! /usr/bin/python3


class PickleMe(object):

def __init__(self):
self.a = "a"

---
filename: pickle_object.py
#! /usr/bin/python3

import pickle
from import_me import PickleMe

p = PickleMe()

with open('pickled', 'wb') as h:
pickle.dump(p, h)

---
filename: trigger.py
#! /usr/bin/python3

import threading
import pickle

import logging

threads = []

def pickle_load_thread():

logging.error("Thread %d loading", threading.get_ident())

try:
with open('pickled', 'rb') as h:
pickle.load(h)
except:
logging.exception("Exception in loading")


def start_pickle_load_thread():

for x in range(2):
load_thread = threading.Thread(target=pickle_load_thread)
load_thread.daemon = True
threads.append(load_thread)

for x in threads:
x.start()


if __name__ == '__main__':

start_pickle_load_thread()

for t in threads:
t.join()

--
components: Library (Lib)
files: reproduce.tar.gz
messages: 341257
nosy: papad
priority: normal
severity: normal
status: open
title: Race condition during pickle.load()
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48294/reproduce.tar.gz

___
Python tracker 

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



[issue36260] Cpython/Lib vulnerability found and request a patch submission

2019-05-02 Thread JUN-WEI SONG

JUN-WEI SONG  added the comment:

Thank you very much for your reply. 


Based on discussions above, consensuses are improving the zipfile 
documentation. 


And we (JUN-WEI SONG &  KunYu Chen) would like to work on this. 


With opinions of Serhiy Storchaka, Christian Heimes and the ideas we have, 
possible pitfalls are listed below.


1. From file itself: 

Decompression may fail due to an incorrect password, an 
incorrect CRC checksum, an incorrect PKZIP format, an 
unsupported compression method, or an unsupported decryption.
 
2. File system: 

Each file system has different limitations such as allowable 
characters in directory entries, the max length of file name, 
the max length of path name, the max size of single file, the 
max number of files, the max number of files in a single 
directory, etc. Decompression will fail as long as these 
limitations are exceeded.

 3. Operating system: 

The lack of memory or disk space would lead to decompression 
failed (see also Zip Bomb). 

 4. Interrupt: 

Users should be careful in interrupting the process of 
decompression, such as control-C or killing the process during 
decompression, which may result in incomplete decompression of 
the archive.

5. Different default behaviors: 

Users should figure out different default extraction behaviors, 
such as when extracting into the existing tree, it will 
overwriting an existing file without asking, or  when in a 
case-insensitive file system, it keeps only one file when 
extracting an archive which contains many files that have the 
same name but different case. 


Please let us know if anything’s missing.

--

___
Python tracker 

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



[issue36772] Let lru_cache be used as a decorator with no arguments

2019-05-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

The 90% use case with dataclasses is satisfied with just "@dataclass", and 
perhaps the target user there is less sophisticated.

But the main difference between @dataclass and @lru_cache is that all of the 
parameters to @dataclass are keyword-only. Which I did because they are mostly 
all booleans, and "@dataclass(True, False, True)" isn't very helpful.

That's not the case with @lru_cache. Whether that makes a difference for this 
issue in particular, I'm not sure.

I agree that this violates "only one way to do it". But I haven't seen anyone 
use "@dataclass()", and I've also never seen anyone be confused by the fact 
that once you want parameters, you change to using parens. For the dataclass 
case, I think that working both ways has been helpful.

--

___
Python tracker 

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



  1   2   >