[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16304
pull_request: https://github.com/python/cpython/pull/16725

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread miss-islington


miss-islington  added the comment:


New changeset 19a3d873005e5730eeabdc394c961e93f2ec02f0 by Miss Islington (bot) 
(Abhilash Raj) in branch 'master':
bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing 
of URLs (GH-15522)" (GH-16724)
https://github.com/python/cpython/commit/19a3d873005e5730eeabdc394c961e93f2ec02f0


--
nosy: +miss-islington

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-10-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16305
pull_request: https://github.com/python/cpython/pull/16725

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-10-11 Thread miss-islington


miss-islington  added the comment:


New changeset 19a3d873005e5730eeabdc394c961e93f2ec02f0 by Miss Islington (bot) 
(Abhilash Raj) in branch 'master':
bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing 
of URLs (GH-15522)" (GH-16724)
https://github.com/python/cpython/commit/19a3d873005e5730eeabdc394c961e93f2ec02f0


--

___
Python tracker 

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



[issue38451] Datetime definition does not work in function definition as list definition

2019-10-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Default arguments are evaluated only once as the function is defined and not 
per call.

This is a common gotcha : 
https://stackoverflow.com/questions/1132941/least-astonishment-and-the-mutable-default-argument

--

___
Python tracker 

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



[issue38451] Datetime definition does not work in function definition as list definition

2019-10-11 Thread Pouria

Pouria  added the comment:

For example
Def a(time=datetime.datetime.today()):
 Print(time)
Output:
The output of each run is equal to the   first time output
 For exaple :
  If you run
  a()
  Sleep(10)
  a()
  Sleep(10)
   a()
  You see one output three time

در تاریخ شنبه ۱۲ اکتبر ۲۰۱۹،‏ ۸:۱۶ Terry J. Reedy 
نوشت:

>
> Terry J. Reedy  added the comment:
>
> Without more information, we cannot do anything with this.
>
> --
> nosy: +terry.reedy
> status: open -> pending
> versions:  -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8
>
> ___
> Python tracker 
> 
> ___
>

--
status: pending -> open

___
Python tracker 

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



[issue38454] test_listdir is failing on ubuntu with WSL

2019-10-11 Thread Batuhan

New submission from Batuhan :

Run tests sequentially
0:00:00 load avg: 0.52 [1/1] test_os
test test_os failed -- Traceback (most recent call last):
  File "/home/isidentical/cpython/Lib/test/test_os.py", line 2059, in 
test_listdir
self.assertEqual(found, expected)
AssertionError: Items in the first set but not the second:
'@test_12966_tmp-�'
Items in the second set but not the first:
'@test_12966_tmp-\udcff'

test_os failed

== Tests result: FAILURE ==

1 test failed:
test_os

Total duration: 2 sec 587 ms
Tests result: FAILURE


System:
 - Ubuntu 18.04 bionic
 - x86_64 Linux 4.4.0-18362-Microsoft

--
components: Tests
messages: 354518
nosy: BTaskaya, steve.dower
priority: normal
severity: normal
status: open
title: test_listdir is failing on ubuntu with WSL
versions: Python 3.9

___
Python tracker 

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



[issue38451] Datetime definition does not work in function definition as list definition

2019-10-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Without more information, we cannot do anything with this.

--
nosy: +terry.reedy
status: open -> pending
versions:  -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Dima Tisnek


Dima Tisnek  added the comment:

Clearly my attention span does not exceed 5 paragraphs, so sorry!

--

___
Python tracker 

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



[issue38378] os.sendfile() has improperly named parameter

2019-10-11 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I’m for renaming both. Since the function is about transmitting or copying (on 
Linux) files src_fd and dst_fd could also be good candidates.

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Eryk Sun


Eryk Sun  added the comment:

> Maybe os.fspath() can be used

I think that would already be the case if genericpath.exists didn't have to 
support file descriptors. It's documented that the path argument "refers to an 
existing path or an open file descriptor".

Modifying _fd_converter would provide consistent behavior for all calls that 
ultimately use argument clinic's path_t(allow_fd=True) and/or dir_fd. Serhiy's 
suggestion to raise a warning sounds good. 

Here are some examples that currently pass silently in Linux:

>>> os.chown(False, 1000, 1000)
>>> os.chmod(False, 0o666)
>>> os.utime(False, (15, 15))

Probably os.fstat and other "f" functions (e.g. fstatvfs, fchdir, fchown, 
fchmod, ftruncate, fdatasync, fsync, and fpathconf) should also raise a warning 
when passed a bool. For example, the following would raise a warning instead of 
passing silently:

>>> os.fstat(False).st_size
0

These cases could be addressed by consistently using an argument clinic type. 
Some of them already us the fildes type (e.g. fchdir, fsync, fdatasync). 
However, fildes_converter calls PyObject_AsFileDescriptor, which also supports 
objects with a fileno() method. That's documented behavior for 
PyObject_AsFileDescriptor, but nothing in the documentation of fchdir, fsync, 
and fdatasync suggests to me that they support objects with a fileno() method:

>>> os.fchdir(sys.stdin)
Traceback (most recent call last):
  File "", line 1, in 
NotADirectoryError: [Errno 20] Not a directory

If not for this behavior, we could simply change all of the "f" functions to 
use the fildes type.

PyObject_AsFileDescriptor is used in various other places as well, such as the 
select module. In the latter case, supporting objects with a fileno() method is 
clearly documented.

Also consider including open() and os.fdopen by modifying _io_open_impl in 
Modules/_io/_iomodule.c. For example:

   >>> open(False, closefd=False)
<_io.TextIOWrapper name=False mode='r' encoding='UTF-8'>

Currently it calls PyNumber_Check(file). If true, a warning could be raised if 
PyBool_Check(file) is also true.

--

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-10-11 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +16303
pull_request: https://github.com/python/cpython/pull/16724

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Abhilash Raj


Change by Abhilash Raj :


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

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Abhilash Raj


Abhilash Raj  added the comment:

Yeah, I agree. I'll submit a PR for reverting the commits.

--

___
Python tracker 

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



[issue38453] ntpath.realpath() should make absolute path earlier

2019-10-11 Thread Steve Dower


Steve Dower  added the comment:

PR 16723 is just for the test fix.

The realpath() fix should get tests that chdir (without change_cwd()) into a 
symlink and then realpath() on a relative path. Today, that should fail to 
resolve the sections in the CWD, and with the fix it should resolve the entire 
path.

--

___
Python tracker 

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



[issue38453] ntpath.realpath() should make absolute path earlier

2019-10-11 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue38453] ntpath.realpath() should make absolute path earlier

2019-10-11 Thread Steve Dower


Steve Dower  added the comment:

Updating change_cwd() in Lib/test/support/__init__.py to call 
chdir(realpath(path)) also fixes the test issues I was facing, but the 
realpath() implementation needs fixing.

--

___
Python tracker 

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



[issue38450] 3.8 Release Notes: IDLE section dupe

2019-10-11 Thread A.M. Kuchling


Change by A.M. Kuchling :


--
pull_requests: +16300
pull_request: https://github.com/python/cpython/pull/16621

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Tal Einat


Tal Einat  added the comment:

Mariano Anaya, you're welcome to work on this and create a PR.

There's no need to have this issue assigned to you: feel free to just begin 
working. Anyone reading this will know that you intended to work on this.

(FYI, we only assign issues to core developers, and assigning means something 
slightly different than "who is working on this.")

--
nosy: +taleinat

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-10-11 Thread Tal Einat


Change by Tal Einat :


--
nosy: +taleinat

___
Python tracker 

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



[issue38453] ntpath.realpath() should make absolute path earlier

2019-10-11 Thread Steve Dower


New submission from Steve Dower :

Because the abspath() call is deferred until the end of the resolution process, 
if the current working directory is not already a real path, it will not be 
fully resolved.

By passing it through abspath() at the start of the function, we ensure that 
the correct path is resolved.

This will help resolve some inconsistencies in the test suite when tests are 
launched with a short filename (FILENA~1) in the working directory (though some 
other fixes are probably needed to help here).

--
components: Windows
messages: 354509
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: ntpath.realpath() should make absolute path earlier
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



[issue38422] Clarify docstrings of pathlib suffix(es)

2019-10-11 Thread Tal Einat


Tal Einat  added the comment:

>From the PR, the rationale for this suggestion is:

"Whenever I use path.suffix I have to check again whether it includes the dot 
or not. I decided to add it to the docstring so I won't have to keep checking."

--
nosy: +taleinat

___
Python tracker 

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



[issue38401] Make dataclass attribute docstrings accessible

2019-10-11 Thread Tal Einat


Tal Einat  added the comment:

Thanks for this suggestion John!

Unfortunately, only the first string literal in the example is a doc-string, 
and the rest indeed are not. (PEP-258 suggested adding such doc-strings, but it 
was rejected.)

There is currently no standard way to attach a doc-string to a field in 
dataclasses, nor in attrs on which dataclasses was mostly based. However, both 
libraries support custom field meta-data, using which one could add such 
per-field documentation. So if one really needs something like this, it is 
possible to work up a custom solution.

Eric is correct that this is far from a straightforward suggestion, which would 
require a significant language change to implement. Due to the depth of the 
change required, it would need to be discussed on Python-ideas mailing list 
first. Please bring this up there if you'd like to pursue this further.

I'm closing this as "rejected" for now since I believe the likelihood of 
pursuing this to be very small, but this can be re-opened later if further 
discussion warrants it.

--
nosy: +taleinat
resolution:  -> rejected
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



[issue38452] unittest setUpClass missing 1 required positional argument: 'cls'

2019-10-11 Thread Zachary Ware


Zachary Ware  added the comment:

`setUpClass` and `tearDownClass` are classmethods and must be decorated as such 
(`@classmethod`).

--
nosy: +zach.ware
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Thanks for looking into this, @maxking. With both 3.8.0 final and 3.7.5 final 
scheduled for just a few days away, I wonder if the best thing to do at this 
point is to revert them and work on a more robust fix targeted for the next 
maintenance releases since the original issue was not identified as being a 
security issue or otherwise critical.

--

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-11 Thread Tal Einat


Tal Einat  added the comment:

I'd certainly be surprised to have the order of zero and negative values in the 
input have such a dramatic effect on the result. It would make debugging these 
cases unnecessarily confusing and difficult. And I think it is indeed worth 
fixing, as these edge-cases are likely to come up of time when dealing with 
large amounts of data.

I'm +1 on Warren's latest suggestion for a fix.

P.S If we agree on this, either Warren should make the fix himself or we should 
mark it "newcomer friendly" and let a newcomer handle it.

--
nosy: +taleinat

___
Python tracker 

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



[issue30672] PEP 538: Unexpected locale behaviour on *BSD (including Mac OS X)

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Since this issue has been created, I deeply reworked the Python Initialization 
with the PEP 587, and I made many changes related to locales and the UTF-8 Mode 
(PEP 540). What's the status of this issue?

--
nosy: +vstinner

___
Python tracker 

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



[issue32238] Handle "POSIX" in the legacy locale detection

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

In Python 3.8, if the LC_CTYPE is "POSIX", the default stdio error handler is 
now "surrogateescape" instead of "strict", and the UTF-8 is now enabled. In 
short, LC_CTYPE="POSIX" now behaves as LC_CTYPE="C".

This change impacts at least FreeBSD. If I correctly, if there is no LC_ALL, 
LC_CTYPE or LANG environment variable on FreeBSD, the LC_CTYPE locale is 
"POSIX".

See bpo-34485, bpo-19977 and the "POSIX locale on FreeBSD" section of my 
article:
https://vstinner.github.io/python3-locales-encodings.html

--

___
Python tracker 

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



[issue38452] unittest setUpClass missing 1 required positional argument: 'cls'

2019-10-11 Thread Danylo


New submission from Danylo :

Currently, unittest setUpClass and tearDownClass methods are incorrectly called 
from within its core.

```
class TestUltrasonicEnv(unittest.TestCase):

def setUpClass(cls):
pass


def tearDownClass(cls):
pass
```

Traceback (the same for teadDownClass)
```
  File "/home/dizcza/anaconda3/envs/robotsim/lib/python3.7/unittest/suite.py", 
line 163, in _handleClassSetUp
setUpClass()
TypeError: setUpClass() missing 1 required positional argument: 'cls'
```

The traceback is self-descriptive.

--
components: Tests
messages: 354501
nosy: dizcza
priority: normal
severity: normal
status: open
title: unittest setUpClass missing 1 required positional argument: 'cls'
versions: Python 3.7

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Abhilash Raj


Abhilash Raj  added the comment:

The bug is interesting due to some of the implementation details of 
"guess_type". The documentation says that it can parse either a URL or a 
filename.

Switching from urllib.parse._splittype to urllib.parse.urlparse changed what a 
valid "path" is. _splittype doesn't care about the rest of the URL except the 
scheme, but urlparse does. Previously, we used to split things like:

   >>> print(urllib.parse._splittype(';1.tar.gz')
   (None, ';1.tar.gz')

Then, we'd just treat the 2nd part as a filesystem path, which would rightfully 
guess the extension as .tar.gz

However, switching to using parsing via urllib.parse.urlparse, we get:

>>> print(urllib.parse.urlparse(';1.tar.gz')
ParseResult(scheme='', netloc='', path='', params='1.tar.gz', query='', 
fragment='')

And then we get the ".path" attribute for further processing, which being 
empty, returns (None, None).

The format of all these parts is:

scheme://netloc/path;parameters?query#fragment

A simple fix would be to just merge path, parameters, query and fragment 
together (with appropriate delimiters) and the proceed with further processing. 
That would fix parsing of Filesystem paths but would break (again) parsing of 
URLs like:

>>> mimetypes.guess_type('http://example.com/index.html;1.tar.gz')
('application/x-tar', 'gzip')

It should return 'text/html' as the type, since this is a URL and everything 
after the ';' should not be used to determine the mimetype. But, if there is no 
scheme provided, we should treat it as a filesystem path and in that case 
'application/x-tar' is the right type.

I hope I am not confusing everyone here. 

The right fix IMO would be to make "guess_type" not treat URLs and filesytem 
paths alike.

--

___
Python tracker 

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



[issue28188] os.putenv should support bytes arguments on Windows

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

This issue was referenced from https://bugs.python.org/issue29240#msg285482

--

___
Python tracker 

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



[issue28188] os.putenv should support bytes arguments on Windows

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

In the meanwhile, the PEP 540 "UTF-8 Mode" has been implemented.

--
nosy: +vstinner

___
Python tracker 

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



[issue38270] Tests: Avoid MD5 or check for MD5 availablity

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

It looks like Christian originally requested autobackports to both 3.8 and 3.7 
but both failed due to git checkout errors.  He then manually restarted the 3.8 
backport but it looks like the 3.7 one did not get restarted.  Christian, was 
that intentional or just an oversight?  If the latter, you should try the 3.7 
backport again.

--
nosy: +ned.deily

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-10-11 Thread Caris Moses


Caris Moses  added the comment:

I tried it with mocked functions instead of methods and got the same result, so 
I dug into this a little deeper. It seems as though the issue it how the mocked 
functions are called. If I replace the do_something() line with the following 
then it works.

#do_something()
manager.set_foo_func(3)
manager.set_bar_func(4)

I am a beginner with unittest so please let me know if I am just using this 
incorrectly. However in the original code I posted, if I 
print(manager.set_foo_func.mock_calls, manager.set_bar_func.mock_calls) I get 
the calls made in do_something(), however print(manager.mock_calls) returns an 
empty list which leads me to believe something else is wrong.

--

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Maybe os.fspath() can be used:

>>> os.fspath(True)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: expected str, bytes or os.PathLike object, not bool

--

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Welcome Victor Stinner. Any chance to get it also backported to 3.6 as I 
> guess this would increase the chance to see it in RedHat 8 where I hit the 
> issue?

Python 3.6 doesn't accept bugfixes upstream.

If you are a Red Hat customer, you can contact the support to request a 
backport. Or you can copy the file from the master branch :-)

--

___
Python tracker 

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



[issue38450] 3.8 Release Notes: IDLE section dupe

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report!  Those whatsnew issues are being addressed in PR 16621.

--
nosy: +ned.deily
resolution:  -> duplicate
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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

I went ahead and ran an instrumented build on some random production code 
(mostly financial data processing), just because I was curious:

BINARY_ADD ops: 3,720,776
BINARY_ADD ops with two lists: 100,452 (2.7% of total)
BINARY_ADD with new fast path: 26,357 (26.2% of list adds, 0.7% of total)

--

___
Python tracker 

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



[issue38341] Add SMTPNotSupportedError in the exports of smtplib

2019-10-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16299
pull_request: https://github.com/python/cpython/pull/16721

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-10-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Oh well :( My initial guess is that the report is for methods. The other 
reports were for functions. So I am wondering if the check for FunctionType is 
successful and if I need to handle something more. I haven't tried it yet.

--

___
Python tracker 

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



[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-11 Thread miss-islington


miss-islington  added the comment:


New changeset 193366e25c4f84a58d2f6c6c577fd9f0143dc6e1 by Miss Islington (bot) 
(Pablo Galindo) in branch '3.7':
[3.7] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16663)
https://github.com/python/cpython/commit/193366e25c4f84a58d2f6c6c577fd9f0143dc6e1


--
nosy: +miss-islington

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-10-11 Thread Caris Moses


Caris Moses  added the comment:

Hello,
I am still running into this issue. I have tested the following code with 
Python 3.7.4, 3.7.5rc1 , and 3.8.0rc1.

from unittest import TestCase
from unittest.mock import patch, Mock, call

class MyObject:
def __init__(self):
self.foo = 0
self.bar = 0

def set_foo(self, value):
self.foo = value

def set_bar(self, value):
self.bar = value

def do_something():
o = MyObject()
o.set_foo(3)
o.set_bar(4)
return 'something unrelated'

class MyObjectTest(TestCase):

@patch('test_mock.MyObject.set_bar', autospec=True)
@patch('test_mock.MyObject.set_foo', autospec=True)
def test_do_something(self, mock_set_foo, mock_set_bar):
manager = Mock()
manager.attach_mock(mock_set_foo, 'set_foo_func')
manager.attach_mock(mock_set_bar, 'set_bar_func')
do_something()
assert manager.mock_calls == [call.set_foo_func(3), 
call.set_bar_func(4)]

--
nosy: +Caris Moses

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Abhilash Raj


Abhilash Raj  added the comment:

I am looking into the issue.

--
nosy: +maxking

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

Serhiy, here are the better performance measurements:


$ ./python.exe -m pyperf timeit --duplicate=1000 -s z=0 z+0  # list-add
.
Mean +- std dev: 17.3 ns +- 0.3 ns

$ ./python.exe -m pyperf timeit --duplicate=1000 -s z=0 z+0  # master
.
Mean +- std dev: 17.2 ns +- 0.3 ns

$ ./python.exe -m pyperf timeit --duplicate=1000 -s l=[0,1,2,3] [0,1,2,3]+l  # 
New branch
.
Mean +- std dev: 92.6 ns +- 1.7 ns

$ ./python.exe -m pyperf timeit --duplicate=1000 -s l=[0,1,2,3] l+[0,1,2,3]  # 
Old branch
.
Mean +- std dev: 99.8 ns +- 1.4 ns


Honestly, I'll defer to you here. If you feel like pursuing this is a total 
waste of time, I'll just close the issue/PR. Otherwise I can explore how often 
the branch is hit in production code, as you suggested.

--

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread Rüdiger Plüm

Rüdiger Plüm  added the comment:

Welcome Victor Stinner. Any chance to get it also backported to 3.6 as I guess 
this would increase the chance to see it in RedHat 8 where I hit the issue?

--

___
Python tracker 

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



[issue36229] Avoid unnecessary copies for list, set, and bytearray ops.

2019-10-11 Thread Armin Rigo


Change by Armin Rigo :


--
nosy:  -arigo

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> I do not see any significant change in + operator timing on my machine 
> (again, just a rough test):

Because the time includes the time of iterating, which can be significant in 
comparison with adding two integers. Please use the pyperf module with 
--duplicate=1000.

> I'm aware that unpacking is "better". With that said, adding a list literal 
> (or a slice of any list, or a list comprehension) to another list is a fairly 
> common operation (I count several dozen examples in the stdlib).

Could you provide any numbers? For example you can patch ceval.c to count these 
BINARY_ADD for which your optimization works and these for which it does not 
work and output counts at the exit of Python. Run several Python programs with 
the modified interpreter. Tests are bad example, but better than nothing. 
Something like hg would be better. You are free to find programs that would 
benefit the most from your optimization.

> And the speed-up is good, even in these cases.

5%. It is not impressive for optimizing a single rare operation.

--

___
Python tracker 

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



[issue36229] Avoid unnecessary copies for list, set, and bytearray ops.

2019-10-11 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +16298
pull_request: https://github.com/python/cpython/pull/16705

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Actually Serhiy is right, I just checked and found this sentence:
```
Alternatively, annotate your generator as having a return type of either 
Iterable[YieldType] or Iterator[YieldType]
```

--
resolution:  -> works for me
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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is already documented, with examples. I do not think the documentation can 
be made better.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

...and obviously the gains are more pronounced for more/longer lists.

In general I'm not married to this change, though. If the consensus is "not 
worth it", I get it.

But it seems like too easy of a win to me.

--

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

If you would like to propose a doc fix, then please go ahead and make a PR.

--

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Eryk, I think testing for bool in _fd_converter and issuing a warning is a good 
idea. Do you want to create a PR?

--
nosy: +serhiy.storchaka

___
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-10-11 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-11 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

Thanks, Pablo, for providing that. So the changes look like mostly a wash on 
these benchmarks. 

Serhiy:

I do not see any significant change in + operator timing on my machine (again, 
just a rough test):

$ ./python.exe -m timeit -s z=0 z+0  # master
1000 loops, best of 5: 21.3 nsec per loop

$ ./python.exe -m timeit -s z=0 z+0  # list-add
1000 loops, best of 5: 21.2 nsec per loop

I'm aware that unpacking is "better". With that said, adding a list literal (or 
a slice of any list, or a list comprehension) to another list is a fairly 
common operation (I count several dozen examples in the stdlib). Even though 
these cases only have two operands, they will still see the speed-up.

And the speed-up is good, even in these cases. You can compare using the new 
code:

$ ./python.exe -m timeit -s l=[0,1,2,3] [0,1,2,3]+l  # Hits new branch
500 loops, best of 5: 87.9 nsec per loop

$ ./python.exe -m timeit -s l=[0,1,2,3] l+[0,1,2,3]  # Hits old branch
500 loops, best of 5: 92.5 nsec per loop

--

___
Python tracker 

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



[issue38451] Datetime definition does not work in function definition as list definition

2019-10-11 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Can you please add an example of the issue and the actual/expected behavior?

--
nosy: +xtreak

___
Python tracker 

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



[issue38432] ZeroDivisionError when inf is expected

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See https://en.wikipedia.org/wiki/Denormal_number.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38451] Datetime definition does not work in function definition as list definition

2019-10-11 Thread Pouria


Change by Pouria :


--
components: Library (Lib)
nosy: Pouria_ff
priority: normal
severity: normal
status: open
title: Datetime definition does not work in function definition as list 
definition
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +vstinner

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think it's any more precise. It just seems verbose and confusing to me, 
while conveying the same information.

`[arg [arg ...]]` to me means "optionally, an arg followed by one or more 
optional args".

While `[arg ...]` to  me means "optionally, one or more args".

So, I'd vote for the simpler version, especially since we're presumably trying 
to communicate with people who aren't BNF or regex experts!

--

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Brandt Bucher


Brandt Bucher  added the comment:

For backward compatibility with 2 metavars, the two-name form should still be 
possible. Just pass metavar=("FOO", "FOO").

--

___
Python tracker 

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



[issue38436] Improved performance for list addition.

2019-10-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I have repeated the benchmark in the speed.python.org server with CPU isolation 
+ PGO + LTO:

Slower (21):
- xml_etree_iterparse: 127 ms +- 2 ms -> 131 ms +- 2 ms: 1.03x slower (+3%)
- xml_etree_parse: 195 ms +- 1 ms -> 200 ms +- 2 ms: 1.03x slower (+3%)
- pickle_list: 5.62 us +- 0.05 us -> 5.76 us +- 0.06 us: 1.03x slower (+3%)
- pickle: 13.2 us +- 0.1 us -> 13.5 us +- 0.1 us: 1.02x slower (+2%)
- scimark_lu: 185 ms +- 3 ms -> 188 ms +- 5 ms: 1.02x slower (+2%)
- scimark_fft: 427 ms +- 2 ms -> 434 ms +- 2 ms: 1.02x slower (+2%)
- sympy_integrate: 25.0 ms +- 0.2 ms -> 25.3 ms +- 0.2 ms: 1.01x slower (+1%)
- spectral_norm: 166 ms +- 3 ms -> 169 ms +- 1 ms: 1.01x slower (+1%)
- scimark_sor: 246 ms +- 6 ms -> 249 ms +- 4 ms: 1.01x slower (+1%)
- sympy_sum: 203 ms +- 2 ms -> 205 ms +- 2 ms: 1.01x slower (+1%)
- chaos: 138 ms +- 1 ms -> 139 ms +- 1 ms: 1.01x slower (+1%)
- json_loads: 37.2 us +- 1.0 us -> 37.5 us +- 0.3 us: 1.01x slower (+1%)
- xml_etree_process: 91.0 ms +- 1.1 ms -> 91.7 ms +- 1.8 ms: 1.01x slower (+1%)
- sympy_str: 315 ms +- 2 ms -> 317 ms +- 2 ms: 1.01x slower (+1%)
- sqlalchemy_declarative: 210 ms +- 3 ms -> 211 ms +- 3 ms: 1.01x slower (+1%)
- regex_compile: 214 ms +- 1 ms -> 215 ms +- 1 ms: 1.01x slower (+1%)
- regex_dna: 268 ms +- 1 ms -> 270 ms +- 1 ms: 1.01x slower (+1%)
- logging_format: 11.2 us +- 0.1 us -> 11.3 us +- 0.2 us: 1.01x slower (+1%)
- unpickle_pure_python: 392 us +- 4 us -> 394 us +- 4 us: 1.00x slower (+0%)
- sympy_expand: 492 ms +- 2 ms -> 493 ms +- 3 ms: 1.00x slower (+0%)
- pidigits: 236 ms +- 1 ms -> 236 ms +- 1 ms: 1.00x slower (+0%)

Faster (21):
- unpack_sequence: 73.9 ns +- 1.3 ns -> 69.3 ns +- 1.0 ns: 1.07x faster (-6%)
- 2to3: 405 ms +- 2 ms -> 393 ms +- 2 ms: 1.03x faster (-3%)
- float: 146 ms +- 1 ms -> 142 ms +- 2 ms: 1.03x faster (-3%)
- scimark_sparse_mat_mult: 5.46 ms +- 0.02 ms -> 5.34 ms +- 0.06 ms: 1.02x 
faster (-2%)
- unpickle: 17.1 us +- 0.1 us -> 16.7 us +- 0.2 us: 1.02x faster (-2%)
- regex_effbot: 3.89 ms +- 0.11 ms -> 3.82 ms +- 0.03 ms: 1.02x faster (-2%)
- json_dumps: 15.9 ms +- 0.1 ms -> 15.7 ms +- 0.1 ms: 1.01x faster (-1%)
- python_startup: 12.4 ms +- 0.1 ms -> 12.3 ms +- 0.0 ms: 1.01x faster (-1%)
- go: 320 ms +- 4 ms -> 316 ms +- 3 ms: 1.01x faster (-1%)
- pathlib: 25.4 ms +- 0.4 ms -> 25.1 ms +- 0.3 ms: 1.01x faster (-1%)
- mako: 19.6 ms +- 0.2 ms -> 19.4 ms +- 0.1 ms: 1.01x faster (-1%)
- fannkuch: 598 ms +- 7 ms -> 591 ms +- 4 ms: 1.01x faster (-1%)
- hexiom: 12.2 ms +- 0.2 ms -> 12.1 ms +- 0.1 ms: 1.01x faster (-1%)
- richards: 85.9 ms +- 1.3 ms -> 85.0 ms +- 1.3 ms: 1.01x faster (-1%)
- python_startup_no_site: 9.18 ms +- 0.05 ms -> 9.09 ms +- 0.02 ms: 1.01x 
faster (-1%)
- genshi_xml: 74.8 ms +- 0.6 ms -> 74.2 ms +- 0.9 ms: 1.01x faster (-1%)
- nbody: 157 ms +- 2 ms -> 155 ms +- 2 ms: 1.01x faster (-1%)
- unpickle_list: 5.89 us +- 0.03 us -> 5.85 us +- 0.04 us: 1.01x faster (-1%)
- genshi_text: 36.7 ms +- 0.4 ms -> 36.5 ms +- 0.3 ms: 1.01x faster (-1%)
- dulwich_log: 80.5 ms +- 0.5 ms -> 80.0 ms +- 0.5 ms: 1.01x faster (-1%)
- regex_v8: 28.9 ms +- 0.1 ms -> 28.9 ms +- 0.1 ms: 1.00x faster (-0%)

Benchmark hidden because not significant (15): chameleon, crypto_pyaes, 
deltablue, logging_silent, logging_simple, meteor_contest, nqueens, 
pickle_dict, pickle_pure_python, raytrace, scimark_monte_carlo, 
sqlalchemy_imperative, sqlite_synth, telco, xml_etree_generate
Ignored benchmarks (3) of json/2019-09-16_14-25-master-89b8933bb537.json.gz: 
django_template, html5lib, tornado_http

--

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks. I'm always looking for ways to make dataclasses easier to use, while 
keeping within the original goals. I'll close this for now.

--
resolution:  -> wont fix
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



[issue35826] Typo in example for async with statement with condition

2019-10-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16297
pull_request: https://github.com/python/cpython/pull/16720

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Shmuel H.


Shmuel H.  added the comment:

The only other solution I could think about was to change setattr's behaviour 
dynamically so that it would be valid to call it from frozen instance's 
`__init__`, but I think it is somehow even worst.

However, thanks for your help, I think we can close this one for now and I'll 
hopefully write that mail in the next day or two.

As for other projects, I doubt I'll find any big projects that use frozen 
dataclasses internally, but I'll try my best to come with one.

(Only now I realize that your the one behind python's dataclasses, keep up the 
good work!).

--

___
Python tracker 

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



[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

This change introduces a potential 3.7 regression; see Issue38449.

--
nosy: +ned.deily

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Ned Deily


Ned Deily  added the comment:

Marking as regression release blocker for 3.7.5 final and 3.8.0 final.

--
keywords: +3.7regression
nosy: +lukasz.langa, martin.panter, ned.deily, vstinner
priority: normal -> release blocker

___
Python tracker 

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



[issue34632] Port importlib_metadata to Python 3.8

2019-10-11 Thread Arne Recknagel


Arne Recknagel  added the comment:

I just learned that metadata is stored as an email, and changing the format was 
rejected in PEP 426. Be that as it may, if it isn't too much of an issue it 
might still be something that should be hidden from users of the module. Noone 
wants to know that this particular duck is actually powered by fins under the 
surface, right?

--

___
Python tracker 

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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2019-10-11 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

> Should I update the Status and Resolution of the issue here, or wait for some 
> kind of confirmation?

The status is changed after the patch is merged. The person that merges will 
usually change the status of the issue or If he/she forgets, anyone with 
developer role can update the status too.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Nick Timkovich


Nick Timkovich  added the comment:

The `[arg [arg ...]]` feels a bit more formal to me, and I might prefer it in 
the example shown where the arg name is fairly short. That said, `man mv` shows 
something like:

mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...

--
nosy: +nicktimko

___
Python tracker 

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



[issue34632] Port importlib_metadata to Python 3.8

2019-10-11 Thread Arne Recknagel


Arne Recknagel  added the comment:

Is there a reason the object returned by importlib.metadata.metadata is an 
EmailMessage and not a dict? If it quacks like a duck it should be a duck, no?

--
nosy: +arne

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Kyle Meyer


Kyle Meyer  added the comment:

I've performed a bisect the issue with the following script:

#!/bin/sh
make -j3 || exit 125
./python <<\EOF || exit 1
import sys
import mimetypes
res = mimetypes.MimeTypes(strict=False).guess_type(";1.tar.gz")
if res[0] is None:
sys.exit(1)
EOF

That points to 87bd2071c7 (bpo-22347: Update mimetypes.guess_type to allow 
proper parsing of URLs (GH-15522), 2019-09-05).  That commit was included in 
3.7.5rc1 when it was cherry picked by 8873bff287.

--
nosy: +kyleam

___
Python tracker 

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



[issue38450] 3.8 Release Notes: IDLE section dupe

2019-10-11 Thread Sebastian Rittau


New submission from Sebastian Rittau :

In the 3.8 release notes (https://docs.python.org/3.8/whatsnew/3.8.html), the 
section "IDLE and idlelib" is duplicated as "idlelib and IDLE". Also, the 
section "gc" and "gzip" between them are not sorted alphabetically like the 
rest of the list.

--
assignee: docs@python
components: Documentation
messages: 354464
nosy: docs@python, srittau
priority: normal
severity: normal
status: open
title: 3.8 Release Notes: IDLE section dupe
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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-10-11 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hummmis this really a regression? The docs say:

> No other methods (except for the constructor) should be overridden in a 
> subclass. In other words, only override the __init__() and run() methods of 
> this class.

So if someone is overriding join() they are out of contract

--
nosy: +pablogsal

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Ruediger Pluem: I merged your change into master and backported to 3.8 
and 3.7. For the 3.7 backport, I skipped tests.

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ed189ce49423f15ba8774ff174c15d03d12bc807 by Victor Stinner in 
branch '3.7':
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) 
(GH-16719)
https://github.com/python/cpython/commit/ed189ce49423f15ba8774ff174c15d03d12bc807


--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Copy of wmanley's comment:
https://github.com/python/cpython/pull/13948#issuecomment-541076882
"""
This caused a regression for people overriding Thread.join to implement custom 
thread interruption. See 
https://stackoverflow.com/questions/50486083/ending-non-daemon-threads-when-shutting-down-an-interactive-python-session
"""

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2019-10-11 Thread Matej Cepl


Change by Matej Cepl :


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



[issue1294959] Problems with /usr/lib64 builds.

2019-10-11 Thread Matej Cepl


Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2019-10-11 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'll try and think of something better.

I know I'm guilty of sending to python-ideas all the time, but discussing 
proposed design decisions like this are what that list is all about.

If you want to bring it up there, I'd focus on making the problem description 
crystal clear, and not so much on any proposed solution. At least for starters.

And, someone will ask what attrs or other projects do to solve this problem, so 
you should research that.

--

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Bob, as OP you get first dibs on a PR.
Brandt, you're next in line :-)

--

___
Python tracker 

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



[issue38444] dataclass: always generate default __init__ on __default_init__

2019-10-11 Thread Shmuel H.


Shmuel H.  added the comment:

I think it was designed to. However, it is not very usable in production for a 
number of reasons:
1. It won't work with frozen instances (you'll have to call 
`object.__setattr__` directly).
2. It gets very messy with more than one or two `InitVar`s which makes it very 
hard to differentiate between "real"
 values, `InitVar`s and the init logic:
```python
from dataclasses import dataclass, InitVar
@dataclass
class DataClass:
member0_init: InitVar[str] = None
member1_init: InitVar[list] = None

member0: int = None
member1: dict = None

def __post_init__(self, member0_init: str, member1_init: list):
if member0_init is not None and self.member0 is None:
self.member0 = int(member0_init)
if member1_init is not None and self.member1 is None:
self.member1 = dict(member1_init)
```
That code should be equivalent to:
```python
from dataclasses import dataclass
from typing import Union
@dataclass
class DataClass:
member0: int
member1: dict

def __init__(self, member0: Union[int, str], member1: Union[dict, list]):
if isinstance(member0, str):
member0 = int(member0)
if isinstance(member1, list):
member1 = dict(member1)

self.__default_init__(member0=member0, member1=member1)
```
Which is much closer to regular python code to someone new for dataclasses.

I would be happy to hear if you have a better solution; I just think it is 
pretty simple and straight-forward.

--

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Yaroslav Halchenko


Yaroslav Halchenko  added the comment:

FWIW, our more complete test filename is 

# python3 -c 'import patoolib.util as ut; print(ut.guess_mime(r" \"\`;b 
|.tar.gz"))'
(None, None)

which works fine with older versions

--

___
Python tracker 

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



[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Yaroslav Halchenko


New submission from Yaroslav Halchenko :

Our tests in DataLad started to fail while building on Debian with Python 
3.7.5rc1 whenever they passed just fine previously with 3.7.3rc1. Analysis 
boiled down to mimetypes

$> ./python3.9 -c 'import mimetypes; mimedb = 
mimetypes.MimeTypes(strict=False); print(mimedb.guess_type(";1.tar.gz"))'   

(None, None)

$> ./python3.9 -c 'import mimetypes; mimedb = 
mimetypes.MimeTypes(strict=False); print(mimedb.guess_type("1.tar.gz"))' 
('application/x-tar', 'gzip')

$> git describe
v3.8.0b1-1174-g2b7dc40b2af


Ref: 

- original issue in DataLad: https://github.com/datalad/datalad/issues/3769

--
components: Library (Lib)
messages: 354455
nosy: Yaroslav.Halchenko
priority: normal
severity: normal
status: open
title: regression - mimetypes guess_type is confused by ; in the filename
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread miss-islington


miss-islington  added the comment:


New changeset 73665b41470532f873315d5ae39906160192320d by Miss Islington (bot) 
in branch '3.8':
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
https://github.com/python/cpython/commit/73665b41470532f873315d5ae39906160192320d


--
nosy: +miss-islington

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16296
pull_request: https://github.com/python/cpython/pull/16719

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler: doesn't provide atomic_uintptr_t

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

Can someone please test PR 16717 with ICC?

--

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler: doesn't provide atomic_uintptr_t

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 16717 which uses a similar approach than python.patch.

--
components: +Build
versions: +Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37415] Error build Python with Intel compiler: doesn't provide atomic_uintptr_t

2019-10-11 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16294
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16717

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16295
pull_request: https://github.com/python/cpython/pull/16718

___
Python tracker 

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



[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2b7dc40b2af6578181808ba73c1533fc114e55df by Victor Stinner 
(Ruediger Pluem) in branch 'master':
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
https://github.com/python/cpython/commit/2b7dc40b2af6578181808ba73c1533fc114e55df


--

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-11 Thread Brandt Bucher

Brandt Bucher  added the comment:

I’m happy to write one. This seems like a pretty straightforward fix.

--

___
Python tracker 

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



[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

2019-10-11 Thread Thomas Caswell


Thomas Caswell  added the comment:

Any update on resolving this?

--

___
Python tracker 

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



[issue38448] test_concurrent_futures: reap_children() reaped child process 26487 on AMD64 RHEL8 Refleaks 3.x

2019-10-11 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 RHEL8 Refleaks 3.x:
https://buildbot.python.org/all/#/builders/272/builds/23

0:27:13 load avg: 4.88 [416/419/1] test_concurrent_futures failed (env changed) 
(17 min 11 sec) -- running: test_capi (7 min 28 sec), test_gdb (8 min 49 sec), 
test_asyncio (23 min 23 sec)
beginning 6 repetitions
123456
.Warning -- reap_children() reaped child process 26487
.
Warning -- multiprocessing.process._dangling was modified by 
test_concurrent_futures
  Before: set()
  After:  {}

--
components: Tests
messages: 354448
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_concurrent_futures: reap_children() reaped child process 26487 on 
AMD64 RHEL8 Refleaks 3.x
versions: Python 3.9

___
Python tracker 

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



[issue38447] test_multiprocessing_spawn: Dangling processes: {} on AMD64 RHEL7 Refleaks 3.7

2019-10-11 Thread STINNER Victor


New submission from STINNER Victor :

AMD64 RHEL7 Refleaks 3.7:
https://buildbot.python.org/all/#/builders/311/builds/22

0:15:09 load avg: 12.21 [311/416/1] test_multiprocessing_spawn failed (env 
changed) (14 min 39 sec) -- running: test_shelve (5 min 11 sec), test_sqlite (1 
min), test_cmd_line_script (1 min 26 sec), test_asyncio (3 min 13 sec), test_io 
(8 min 6 sec), test_pickle (53.8 sec), test_concurrent_futures (12 min 52 sec)
beginning 6 repetitions
123456
Warning -- Dangling processes: {}
Warning -- Dangling processes: {}
.Warning -- Dangling processes: {}
.

--
components: Tests
messages: 354447
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn: Dangling processes: 
{} on AMD64 RHEL7 Refleaks 3.7
versions: Python 3.7

___
Python tracker 

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



[issue32561] Add API to io objects for cache-only reads/writes

2019-10-11 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to leave not attempt to put "async or "await" in the io module to 
keep it a "simple" as possible, but fix bpo-13322 (in io and _pyio modules).

Instead, I suggest to write a new module only providing asynchronous methods, 
maybe even for open() and close(). But the new module can reuse the existing io 
module to avoid having to write complex algorithm like read-ahead, buffering, 
etc.

Well, I'm not 100% sure that it's doable, since io is hiding many 
implementation details, there are complex issues like multithreading, locks, 
interlaced read and write operations, etc.

Note: The io module doesn't fully suppored interlaced read and write :-) See 
bpo-12215 for example.

--

___
Python tracker 

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



  1   2   >