[issue37095] [Feature Request]: Add zstd support in tarfile

2019-11-24 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue35381] posixmodule: convert statically allocated types (DirEntryType & ScandirIteratorType) to heap-allocated types

2019-11-24 Thread Eddie Elizondo


Eddie Elizondo  added the comment:

PR with fix is out.

--

___
Python tracker 

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



[issue38803] test_wait3 and test_wait4 leaked references on x86 Gentoo Refleaks 3.x

2019-11-24 Thread Eddie Elizondo


Eddie Elizondo  added the comment:

Victor, the PR with the fix is out. Easy catch after running it with my leak 
detector!

--

___
Python tracker 

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



[issue38803] test_wait3 and test_wait4 leaked references on x86 Gentoo Refleaks 3.x

2019-11-24 Thread Eddie Elizondo


Change by Eddie Elizondo :


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

___
Python tracker 

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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2019-11-24 Thread Tzu-ping Chung

Tzu-ping Chung  added the comment:

> If you don't use activate.bat, but just run the venv's python directly, what 
> do you see? I get:
> What shell are you using? Above is with cmd.exe.

I get the same result as activating (i.e. shows the base interpeter). All 
results in cmd.exe as well.

> If you "echo %PATH%" after activate.bat, what do you see?
> Before running activate.bat, do you have a python.exe in your path? If so, is 
> it the one that subprocess is reporting?

PATH is as expected, the venv’s Scripts directory at the front after 
activation. I (only) have a python.exe from Windows Store in PATH. The one 
reported by subprocess is not in PATH.

I’ll try to find a clean machine (maybe a VM) and try whether I can replicate 
this. BTW the problematic versions for me was 3.7.5 and 3.8.0.

--

___
Python tracker 

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



[issue38861] zipfile: Corrupts filenames containing non-UTF8 characters

2019-11-24 Thread John Goerzen


John Goerzen  added the comment:

I can tell you that the zip(1) on Unix systems has never done re-encoding to 
cp437; on a system that uses latin-1 (or any other latin-* for that matter) the 
filenames in the ZIP will be encoded in latin-1.  Furthermore, this doesn't 
explain the corruption that extractall() causes.

--

___
Python tracker 

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



[issue38625] SpooledTemporaryFile does not seek correctly after being rolled over

2019-11-24 Thread Inada Naoki


Inada Naoki  added the comment:

SpooledTemporaryFile has very serious bug which causes data corruption 
(#26730).  Please don't use it with text mode until it is fixed.

--

___
Python tracker 

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



[issue38861] zipfile: Corrupts filenames containing non-UTF8 characters

2019-11-24 Thread Jon Nalley


Jon Nalley  added the comment:

I think the Python implementation is adhering to the zip specification.

>From the specification v6.3.6 (Revised: April 26, 2019):

If general purpose bit 11 is unset, the file name and comment SHOULD conform 
to the original ZIP character encoding.  If general purpose bit 11 is set, the 
filename and comment MUST support The Unicode Standard, Version 4.1.0 or 
greater using the character encoding form defined by the UTF-8 storage 
specification.

https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

--
nosy: +jnalley

___
Python tracker 

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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2019-11-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

Your failing test case with 3.7 works for me.

If you don't use activate.bat, but just run the venv's python directly, what do 
you see? I get:

>py -m venv fooenv

>fooenv\Scripts\python -V
Python 3.7.0

>fooenv\Scripts\python -q
>>> import subprocess
>>> subprocess.check_output(['python', '-c', 'import sys; 
>>> print(sys.executable)'])
b'C:\\Users\\XXX\\fooenv\\Scripts\\python.exe\r\n'

What shell are you using? Above is with cmd.exe.

If you "echo %PATH%" after activate.bat, what do you see?

Before running activate.bat, do you have a python.exe in your path? If so, is 
it the one that subprocess is reporting?

--
nosy: +eric.smith

___
Python tracker 

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



[issue38901] Add a CLI flag to venv to use the pwd basename as the prompt

2019-11-24 Thread Julien Palard


Julien Palard  added the comment:

I like the idea and I think I will use it!

As it's a bit long to type, I'm searching if other shorter variants could be 
usefull like:

python3 -m venv --here
python3 -m venv --cwd
python3 -m venv --project

being the equivalent of `python3 -m venv --basename-prompt venv`, but I'm not 
satisfied with the names (and it enforces using "venv" as a directory name)...

--
nosy: +mdk

___
Python tracker 

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



[issue38547] test_pty fails when using setsid()

2019-11-24 Thread David Bolen


David Bolen  added the comment:

I think fixing the underlying pty issue should certainly be the goal, but the 
question is whether the process group change should remain active in the 
meantime, as its presence is causing a regression in the tests.  I think such 
cases in the past are usually rolled back, right?

I was originally on the fence since process groups address a real problem, 
especially in interactive testing, while creating an arguably aesthetic issue 
for my case of the buildbots (a warning rather than failure).

But Pablo's point about a normal manual full test run failing (not a warning as 
with the buildbots) feels persuasive since that's probably as common as the 
issue being addressed by the change.  Even if pre-existing, the pty failure is 
exposed by the process group change, so it might be best for the process group 
change to wait on fixing the pty issue.

I don't know how to weigh the relative impact though, e.g,. how many people are 
likely to run into each failure case.  There's probably more people doing a 
normal test run than breaking out of such tests though.  At the least, it's a 
worst impact than just the warnings on the buildbots.

Perhaps an intermediate fallback could be gating the process group change 
behind a regrtest option (opt-in) which could then preserve its benefits upon 
request, without negatively impacting the default test process, whether manual 
or on the buildbots.

At least until resource is available to resolve the pty issue.

--

___
Python tracker 

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



[issue38901] Add a CLI flag to venv to use the pwd basename as the prompt

2019-11-24 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Maybe it makes sense to add a `--basename-prompt` flag to set the prompt to 
> the current working directory's basename?

What does this buy you beyond using

--prompt $(basename $PWD)

? Perhaps I'm not understanding what you're getting at - how about an example 
of what you mean?

--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2019-11-24 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 27fc3b6f3fc49a36d3f962caac5c5495696d12ed by Pablo Galindo in 
branch 'master':
bpo-38870: Expose a function to unparse an ast object in the ast module 
(GH-17302)
https://github.com/python/cpython/commit/27fc3b6f3fc49a36d3f962caac5c5495696d12ed


--

___
Python tracker 

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



[issue38547] test_pty fails when using setsid()

2019-11-24 Thread STINNER Victor


STINNER Victor  added the comment:

Can't we fix test_pty?

--

___
Python tracker 

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



[issue38547] test_pty fails when using setsid()

2019-11-24 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> What do you mean by "limited"?

I mean to deactivate it by default and make opt-in.

> Process groups really help to prevent to leak grandchild processes in 
> multiprocessing tests, when tests are interrupted manually by CTRL+C or by a 
> timeout (sadly, only when the timeout is handled by regrtest, not when it's 
> handled by faulthandler).

I love process groups and they are awesome. But having these test being re-run 
on every buildbot and failing on my machine when just running test with -j is 
very annoying.

--

___
Python tracker 

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



[issue38547] test_pty fails when using setsid()

2019-11-24 Thread STINNER Victor


STINNER Victor  added the comment:

> I think this needs to be fixed or process groups in regrtest should be 
> limited or reverted.

What do you mean by "limited"?

Process groups really help to prevent to leak grandchild processes in 
multiprocessing tests, when tests are interrupted manually by CTRL+C or by a 
timeout (sadly, only when the timeout is handled by regrtest, not when it's 
handled by faulthandler).

See bpo-38502 for the rationale.

--

___
Python tracker 

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



[issue37292] _xxsubinterpreters: Can't unpickle objects defined in __main__

2019-11-24 Thread Lewis Gaul


Lewis Gaul  added the comment:

The relevant code for the multiprocessing example seems to be in 
Lib/multiprocessing/spawn.py. I think I get what it's doing, but I'm not sure 
whether we actually need something similar for subinterpreters. Any thoughts 
@eric.snow?

--

___
Python tracker 

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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 6bf644ec82f14cceae68278dc35bafb00875efae by Terry Jan Reedy in 
branch 'master':
 bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines  (GH-17366)
https://github.com/python/cpython/commit/6bf644ec82f14cceae68278dc35bafb00875efae


--

___
Python tracker 

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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16855
pull_request: https://github.com/python/cpython/pull/17371

___
Python tracker 

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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-24 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16854
pull_request: https://github.com/python/cpython/pull/17370

___
Python tracker 

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



[issue38876] pickle is raising KeyError insteat of pickle.UnpicklingError under certain conditions

2019-11-24 Thread Alexandre Vassalotti


Change by Alexandre Vassalotti :


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



[issue38603] inspect.getdoc could examine the __class__ cell for dynamically generated subclasses

2019-11-24 Thread Batuhan


Change by Batuhan :


--
nosy: +yselivanov

___
Python tracker 

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



[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-24 Thread Eryk Sun


Change by Eryk Sun :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-24 Thread Eryk Sun


Eryk Sun  added the comment:

In Windows, using CopyFileExW and CreateDirectoryExW (with a template 
directory, for copytree) doesn't agree with how shutil implements copying with 
separate copyfile and copymode/copystat functions. We'd have to extend 
copyfile() to support alternate data streams, and we'd have to extend 
copystat() to support file attributes, extended attributes, and 
security-resource attributes. Or we'd have to abandon consistency between copy2 
and copyfile+copystat.

--
nosy: +eryksun

___
Python tracker 

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



[issue38625] SpooledTemporaryFile does not seek correctly after being rolled over

2019-11-24 Thread R. David Murray


R. David Murray  added the comment:

The docs currently say "The returned object is a file-like object whose _file 
attribute is either an io.BytesIO or io.StringIO object (depending on whether 
binary or text mode was specified) or a true file object, depending on whether 
rollover() has been called."  The fact that taking an iterator gets you 
whatever the *current* _file object is is implied by that but not made 
explicit.  A doc update to make that explicit would probably be appropriate.

--

___
Python tracker 

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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-24 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Currently, iomenu.IOBinding.fixnewlines makes sure that when a non-empty 
non-Shell file is saved (and possibly run), it ends with at least 1 newline.  
At one time, I believe, compile needed this, and it is still good practice.  
(Git diffs note the absence of a final newline.)

I originally planned to incorporate possible newline addition into do_rstrip, 
in anticipation of calling do_rstrip on save, but I have changed my mind, at 
least for the present.  That code can stay where it is.  If someone explicitly 
runs Strip Trailing Whitespace, adding a newline would sometimes be desired, 
but would sometimes be unexpected and possibly a nuisance.  do_rstrip will 
ensure that non-Shell files end with at most 1 newline.

My revised intent is that once we strip on save, saved files should be  
properly formatted for use or merging into a repository.

--
nosy: +rhettinger, taleinat

___
Python tracker 

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



[issue38876] pickle is raising KeyError insteat of pickle.UnpicklingError under certain conditions

2019-11-24 Thread miss-islington


miss-islington  added the comment:


New changeset 6f03b236c17c96bc9f8a004ffa7e7ae0542e9cac by Miss Islington (bot) 
(Claudiu Popa) in branch 'master':
bpo-38876: Raise pickle.UnpicklingError when loading an item from memo for 
invalid input (GH-17335)
https://github.com/python/cpython/commit/6f03b236c17c96bc9f8a004ffa7e7ae0542e9cac


--
nosy: +miss-islington

___
Python tracker 

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



[issue38698] While parsing email message id: UnboundLocalError

2019-11-24 Thread R. David Murray


R. David Murray  added the comment:

Actually, the success path there should also check that value is empty, and if 
it is not register a defect for that as well.

--

___
Python tracker 

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



[issue38672] mimetypes.init() fails if no access to one of known files

2019-11-24 Thread R. David Murray


R. David Murray  added the comment:

I haven't looked at this in detail, but here are my general thoughts: I think 
it would be reasonable to expect that the module would function even if the 
file permissions are screwed up, similar to how unix commands that try to read 
.netrc will (try to) function even if its permissions are wrong.  I would, 
however, expect the module to emit a warning in that case.  I'm of two minds 
about the behavior when the caller specifies filenames explicitly.  I could see 
that going either way, but I lean slightly toward making the behavior 
consistent.  While the programmer might appreciate the traceback, the user of 
the program would probably appreciate the "try to keep going" behavior, since 
the filenames provided will often be in the same class of "standard defaults" 
as the existing well known files are, just in the context of that particular 
application.  But like I said, that is just a lean, and I could go the other 
way on this as well :)

I haven't looked at the isflie issue, but it seems reasonable that if the path 
exists we should make sure it is a file before reading it...but perhaps readfp 
will effectively do that?  Write a test and see what happens :)

I don't know whether to call this change a bug fix or a feature, so I guess 
we'd default to feature unless someone can tilt the balance with an argument :)

--

___
Python tracker 

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



[issue38524] functools.cached_property is not supported for setattr

2019-11-24 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue38698] While parsing email message id: UnboundLocalError

2019-11-24 Thread R. David Murray


R. David Murray  added the comment:

More tests are always good :)

The "correct" solution here (as far as I remember, its has been a while since 
I've had time to even looked at the _header_value_parser code) would be to add 
a new 'invalid-msg-id' token, and do this:

message_id = MessageID()
try:
token, value = get_msg_id(value)
message_id.append(token)
except HeaderParseError as ex:
message_id = InvalidMessageID(value)
message_id.defects.append(InvalidHeaderDefect(
f"Invalid msg_id: {ex}"))
return message_id

--

___
Python tracker 

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



[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-11-24 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ran 168 tests in 160.415s
OK (skipped=3)
Warning -- multiprocessing.process._dangling was modified by 
test_concurrent_futures
  Before: set()
  After:  {}

Another failure in AMD64 RHEL8 LTO + PGO 3.x

https://buildbot.python.org/all/#/builders/284/builds/300/steps/5/logs/stdio

--
nosy: +pablogsal

___
Python tracker 

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



[issue38547] test_pty fails when using setsid()

2019-11-24 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Indeed, almost all buildbots have to repeat the test_pty.

I think this needs to be fixed or process groups in regrtest should be limited 
or reverted.

--

___
Python tracker 

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



[issue38547] test_pty fails when using setsid()

2019-11-24 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This also happens when running the test suite with high parallelism:

./python -m test -j 20

This fails with:


== Tests result: FAILURE ==

398 tests OK.

2 tests failed:
test_embed test_pty

--
nosy: +pablogsal

___
Python tracker 

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



[issue38907] Add IPv6 Dual-Stack control for http.server

2019-11-24 Thread JIanqiu Tao


JIanqiu Tao  added the comment:

"--no-dual-stack" seems to be a better argument name. "--ipv6-only" lead to 
ambiguity in a IPv4 only environment.

--

___
Python tracker 

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



[issue38908] Troubles with @runtime_checkable protocols

2019-11-24 Thread Ivan Levkivskyi


New submission from Ivan Levkivskyi :

The PEP 544 specifies that:

A protocol can be used as a second argument in isinstance() and issubclass() 
only if it is explicitly opt-in by @runtime_checkable decorator.

It is not specified exactly whether this should be enforced by static type 
checkers or at runtime. Currently it is enforced in both cases: mypy flags this 
as error, and a TypeError is raised at runtime.

There is however a problem with current runtime implementation: abc and 
functools modules may call issubclass() on non-runtime checkable protocols if 
they appear as explicit superclasses. This is currently solved by a 
sys._getframe() hack in  typing module.

The problem is that current solution is incomplete. For example, the TypeError 
is not raised in the case of non-method protocols:

>>> class P(Protocol):
... x: int
... 
>>> 
>>> class C: ...
... 
>>> isinstance(C(), P)
False  # should be TypeError

I tried to fix it this morning but after an hour of attempts to tweak the 
existing hack I gave up. It looks like there are only two reasonable solutions:

* Don't enforce @typing.runtime_checkable at runtime, make it a 
type-checker-only feature (like @typing.final).
* Add a little helper to abc module that would skip classes in MRO for which 
C._is_protocol is True but C._is_runtime_protocol is False.

Any thoughts/preferences?

--
components: Library (Lib)
messages: 357400
nosy: gvanrossum, levkivskyi
priority: normal
severity: normal
status: open
title: Troubles with @runtime_checkable protocols
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue38907] Add IPv6 Dual-Stack control for http.server

2019-11-24 Thread JIanqiu Tao


New submission from JIanqiu Tao :

In Python 3.8+, when we run the http.server in a PC that support IPv6, it will 
bind IPv6 socket normally. On Linux or some other platforms, it also bind IPv4, 
that's pretty good, but on Windows, it doesn't work and "--bind 0.0.0.0" have 
to be provided to make it works in IPv4 environment.
In another case, once someone only want the http.server provide service in IPv6 
environment, but linux will still bind IPv4 socket automatically.

Could we add a argument such as "--ipv6-only" for http.server and open the 
support of Dual-Stack socket by default?

--
components: Library (Lib)
messages: 357399
nosy: zkonge
priority: normal
severity: normal
status: open
title: Add IPv6 Dual-Stack control for http.server
type: enhancement
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue38446] Ambiguous signature for builtins.__build_class__

2019-11-24 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue38804] Regular Expression Denial of Service in http.cookiejar

2019-11-24 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e6499033032d5b647e43a3b49da0c1c64b151743 by Victor Stinner in 
branch '2.7':
bpo-38804: Fix REDoS in http.cookiejar (GH-17157) (GH-17345)
https://github.com/python/cpython/commit/e6499033032d5b647e43a3b49da0c1c64b151743


--

___
Python tracker 

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



[issue37063] Incorrect application of func.__defaults__ by inspect's signature APIs

2019-11-24 Thread Batuhan


Batuhan  added the comment:

As mentioned in docs, getfullargspec is based on signature() and signature 
objects doesnt keep record of all defaults. It tries to map defaults with 
parameters but if you have less default then total parameter amount it will 
discard rest of defaults. IMHO this isn't a bug.

--
nosy: +BTaskaya, yselivanov

___
Python tracker 

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



[issue38901] Add a CLI flag to venv to use the pwd basename as the prompt

2019-11-24 Thread Florian Dahlitz


Change by Florian Dahlitz :


--
nosy: +DahlitzFlorian

___
Python tracker 

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



[issue37095] [Feature Request]: Add zstd support in tarfile

2019-11-24 Thread lilydjwg


Change by lilydjwg :


--
nosy: +lilydjwg

___
Python tracker 

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



[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2019-11-24 Thread AnLong


Change by AnLong :


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

___
Python tracker 

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



[issue37292] _xxsubinterpreters: Can't unpickle objects defined in __main__

2019-11-24 Thread Lewis Gaul


Lewis Gaul  added the comment:

Just to move the conversation from the subinterpreters project repo to here...

I'm going to take a look at how this is done by subprocess using the example 
provided by Guido:

import os
from concurrent.futures import ProcessPoolExecutor
from multiprocessing import get_context

class C:
def __getstate__(self):
print("pickled in %d" % os.getpid())
return {}

def __setstate__(self, state):
print("unpickled in %d" % os.getpid())

def hello(self):
print("Hello world")


if __name__ == "__main__":
with ProcessPoolExecutor(mp_context=get_context("spawn")) as ex:
ex.submit(C().hello).result()

Output:

pickled in 23480
unpickled in 23485
Hello world

--
nosy: +LewisGaul

___
Python tracker 

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



[issue38834] TypedDict: no way to tell which (if any) keys are optional at runtime

2019-11-24 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


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



[issue38906] copy2 doesn't copy metadata on Windows and MacOS

2019-11-24 Thread Gregg Tavares


New submission from Gregg Tavares :

MacOS have extended file attributes. Windows has both extended file attributes 
and alternate streams. In both OSes copy/cp and of course the Finder and 
Windows Explorer copy all this data. Python copy2 does not. 

On Windows it seems like CopyFileW needs to be called to actually do a full 
copy.

https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-copyfilew

On MacOS it appears to require copyItem

https://developer.apple.com/documentation/foundation/filemanager/1412957-copyitem

It's kind of unexpected to call a function to copy a file and have it not 
actually copy the file and have the user lose data

Windows example

> dir


Directory: C:\Users\gregg\temp\test


ModeLastWriteTime Length Name
- -- 
-a   11/24/2019   8:58 PM 28 original.txt


> Set-Content -Path original.txt -Stream FooBar

cmdlet Set-Content at command pipeline position 1
Supply values for the following parameters:
Value[0]: python should copy this too
Value[1]:

> Get-Content -Path original.txt -Stream FooBar
python should copy this too
> copy .\original.txt .\copied-with-copy.txt
> Get-Content -Path copied-with-copy.txt -Stream FooBar
python should copy this too
> C:\Users\gregg\AppData\Local\Programs\Python\Python38\python.exe
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.copy2("original.txt", "copied-with-python3.txt")
>>> exit()
> Get-Content -Path copied-with-python3.txt -Stream FooBar
> Get-Content : Could not open the alternate data stream 'FooBar' of the file 
> 'C:\Users\gregg\temp\test\copied-with-python3.txt'.
At line:1 char:1
+ Get-Content -Path copied-with-python3.txt -Stream FooBar
+ 
 + CategoryInfo  : ObjectNotFound: 
(C:\Users\gregg\...ith-python3.txt:String) [Get-Content], FileNotFoundException
 + FullyQualifiedErrorId : 
GetContentReaderFileNotFoundError,Microsoft.PowerShell.Commands.GetContentCommand





MacOS example

$ ls -l -@
total 1120
-rw-r--r--@ 1 gregg  staff  571816 Nov 24 18:48 original.jpg
com.apple.lastuseddate#PS   16 
com.apple.macl  72 
com.apple.metadata:kMDItemWhereFroms   530 
com.apple.quarantine57 
$ cp original.jpg copied-with.cp 
$ ls -l -@  
total 2240
-rw-r--r--@ 1 gregg  staff  571816 Nov 24 18:48 copied-with.cp
com.apple.lastuseddate#PS   16 
com.apple.macl  72 
com.apple.metadata:kMDItemWhereFroms   530 
com.apple.quarantine57 
-rw-r--r--@ 1 gregg  staff  571816 Nov 24 18:48 original.jpg
com.apple.lastuseddate#PS   16 
com.apple.macl  72 
com.apple.metadata:kMDItemWhereFroms   530 
com.apple.quarantine57
$python3
Python 3.8.0 (default, Nov 24 2019, 18:48:01) 
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.copy2('original.jpg', 'copied-with-python3.jpg')
'copied-with-python3.jpg'
>>> exit()
$ ls -l -@
total 3360
-rw-r--r--@ 1 gregg  staff  571816 Nov 24 18:48 copied-with-python3.jpg
com.apple.quarantine57 
-rw-r--r--@ 1 gregg  staff  571816 Nov 24 18:48 copied-with.cp
com.apple.lastuseddate#PS   16 
com.apple.macl  72 
com.apple.metadata:kMDItemWhereFroms   530 
com.apple.quarantine57 
-rw-r--r--@ 1 gregg  staff  571816 Nov 24 18:48 original.jpg
com.apple.lastuseddate#PS   16 
com.apple.macl  72 
com.apple.metadata:kMDItemWhereFroms   530 
com.apple.quarantine57

--
components: Library (Lib), Windows, macOS
messages: 357395
nosy: greggman, ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: copy2 doesn't copy metadata on Windows and MacOS
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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2019-11-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eryksun

___
Python tracker 

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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2019-11-24 Thread Tzu-ping Chung


Tzu-ping Chung  added the comment:

3.6 works correctly on Windows:

> py -3.6 -m venv test36
> test36\Scripts\activate.bat
>>> import subprocess
>>> print(subprocess.check_output(['python', '-c', 'import sys; 
>>> print(sys.executable)']))
b'C:\\Users\\uranusjr\\Downloads\\test36\\Scripts\\python.exe\r\n'

So it seems the problem is introduced sometime after.

--

___
Python tracker 

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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2019-11-24 Thread Tzu-ping Chung


Tzu-ping Chung  added the comment:

Linux works correctly (Ubuntu with self-compiled Python 3.7.5)

$ python3.7 -m venv fooenv
$ . fooenv/bin/activate
(fooenv) $ python -c "import sys; print(sys.executable)"
/home/uranusjr/fooenv/bin/python
(fooenv) $ python -q
>>> import subprocess
>>> subprocess.check_output(['python', '-c', 'import sys; 
>>> print(sys.executable)'])
b'/home/uranusjr/fooenv/bin/python\n'

--

___
Python tracker 

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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2019-11-24 Thread Tzu-ping Chung


New submission from Tzu-ping Chung :

To reproduce:

> py -m venv fooenv
> fooenv\Scripts\activate.bat
(fooenv) > python -c "import sys; print(sys.executable)"  % This is correct
C:\Users\uranusjr\Downloads\venvtest\Scripts\python.exe
(fooenv) > python -q
>>> import subprocess
>>> subprocess.check_output(['python', '-c', 'import sys; 
>>> print(sys.executable)'])
b'C:\\Users\\uranusjr\\AppData\\Local\\Programs\\Python\\Python37\\python.exe\r\n'

The output shows the base interpreter, not the interpreter in venv. Not sure 
whether this is a venv or subprocess problem.

--
components: Library (Lib), Windows
messages: 357392
nosy: paul.moore, steve.dower, tim.golden, uranusjr, zach.ware
priority: normal
severity: normal
status: open
title: venv python reports wrong sys.executable in a subprocess on Windows
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