[issue37615] json - make load and dump work with filenames and path-like objects

2019-07-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This looks similar to issue36378 which was rejected and has a link to previous 
mailing list discussion.

--
nosy: +xtreak

___
Python tracker 

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



[issue37615] json - make load and dump work with filenames and path-like objects

2019-07-17 Thread Varun Agrawal


New submission from Varun Agrawal :

Currently, json.load and json.dump take file pointers, aka file-like objects 
which have support for `.write()` and `.read()`. This necessitates the 
following pattern of code on a regular basis:

```
with open(filename) as f:
o = json.load(f)
...
with open(filename, 'w') as f:
json.dump(o, f)
```

While this is a fair pattern to live by, it would be nice for programmers to 
pass in the filename directly and let the functions handle opening and closing 
the file.

The way to do this would be to have a simple check if `fp` is a path-like 
object or a file-like object, and set up a context manager accordingly (using 
contextlib).
The original `load()` and `dump()` code definition can then be placed inside 
the context manager, which should make testing painless.

There might be an argument for this not being in alignment with duck-typing, 
but the overall benefits of this approach along with the ease afforded to 
programmers should make for a strong argument.

--
components: Library (Lib)
messages: 348097
nosy: varunagrawal
priority: normal
severity: normal
status: open
title: json - make load and dump work with filenames and path-like objects
type: enhancement
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



[issue37614] Pasteing into idle makes it crash

2019-07-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please add your operating system and environment information? It seems 
similar to issue37286 and issue13153 in Windows.

--
nosy: +xtreak

___
Python tracker 

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



[issue37614] Pasteing into idle makes it crash

2019-07-17 Thread Colby Reeves

New submission from Colby Reeves :

Like the title says pasting  (or U+1F339) into IDLE makes IDLE instantaneously 
crash.

--
assignee: terry.reedy
components: IDLE
messages: 348095
nosy: Colby Reeves, terry.reedy
priority: normal
severity: normal
status: open
title: Pasteing into idle makes it crash
type: crash
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



[issue37608] _thread: acquire_lock, release_lock still in use while declared to be "gone" in Documentation

2019-07-17 Thread 徐靖

徐靖  added the comment:

I got it that it is just my misunderstanding.
Thanks.

--

___
Python tracker 

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



[issue37602] nonzero fixer problem

2019-07-17 Thread 徐靖

徐靖  added the comment:

Got it.
I am just testing all changes in Python 3.X (in preparation for a project 
porting to 3.7 before I have permission to view the source code), and call 
__nonzero__() directly for testing. So maybe I cannot provide an example. 
I did not realize that it should not be called directly.
Still, I recommend a documentation change to explain this fact, telling readers 
the fixer will not change the usage of __nonzero__().
Thanks for your reply.

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



[issue36390] IDLE: Move formatting functions into new format module.

2019-07-17 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue36390] IDLE: Move formatting functions into new format module.

2019-07-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 5eb19fddd2d6c70ded14a91cf083681d750d593b by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.7':
bpo-36390: Gather IDLE Format menu functions into format.py (GH-14827) 
(GH-14830)
https://github.com/python/cpython/commit/5eb19fddd2d6c70ded14a91cf083681d750d593b


--

___
Python tracker 

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



[issue36390] IDLE: Move formatting functions into new format module.

2019-07-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 028f1d2479a9a508e1f0bfcff42c20c348244549 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.8':
bpo-36390: Gather IDLE Format menu functions into format.py (GH-14827) 
(GH-14829)
https://github.com/python/cpython/commit/028f1d2479a9a508e1f0bfcff42c20c348244549


--

___
Python tracker 

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



[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-07-17 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

___
Python tracker 

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



[issue36390] IDLE: Move formatting functions into new format module.

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14622
pull_request: https://github.com/python/cpython/pull/14829

___
Python tracker 

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



[issue36390] IDLE: Move formatting functions into new format module.

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14623
pull_request: https://github.com/python/cpython/pull/14830

___
Python tracker 

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



[issue36390] IDLE: Move formatting functions into new format module.

2019-07-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 1b3892243433da7eae7f5f3a4f98f13d309c8926 by Terry Jan Reedy in 
branch 'master':
bpo-36390: Gather IDLE Format menu functions into format.py (#14827)
https://github.com/python/cpython/commit/1b3892243433da7eae7f5f3a4f98f13d309c8926


--

___
Python tracker 

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



[issue37613] Broken "Back to top" link in www.python.org (mobile)

2019-07-17 Thread Mariatta


Mariatta  added the comment:

Thanks for the report.
The issue tracker for python.org website is at 
https://github.com/python/pythondotorg/issues

PR should be proposed there instead of python/cpython.

--
assignee: docs@python -> 
nosy: +Mariatta
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37613] Broken "Back to top" link in www.python.org (mobile)

2019-07-17 Thread Giovanni Cappellotto


Giovanni Cappellotto  added the comment:

I can reproduce the error in Chrome for MacOS when I emulate the resolution of 
a generic mobile device.

I think I have a quick fix for the issue, I will publish a PR soon.

--

___
Python tracker 

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



[issue37613] Broken "Back to top" link in www.python.org (mobile)

2019-07-17 Thread Giovanni Cappellotto


Change by Giovanni Cappellotto :


--
title: Fix broken "Back to top" link in www.python.org (mobile) -> Broken "Back 
to top" link in www.python.org (mobile)

___
Python tracker 

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



[issue37613] Fix broken "Back to top" link in www.python.org (mobile)

2019-07-17 Thread Giovanni Cappellotto


New submission from Giovanni Cappellotto :

The mobile version of https://www.python.org/ has a "Back to top" link at the 
bottom of every page that should scroll the page back to the top, but it 
doesn't work in Chrome for Android.

Note: it works with Safari on iOS.

--
assignee: docs@python
components: Documentation
messages: 348087
nosy: docs@python, potomak
priority: normal
severity: normal
status: open
title: Fix broken "Back to top" link in www.python.org (mobile)

___
Python tracker 

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



[issue37612] os.link(..., follow_symlinks=True) broken on Linux

2019-07-17 Thread Jo Henke


New submission from Jo Henke :

Regarding link() POSIX states 
(https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html):

  "If path1 names a symbolic link, it is implementation-defined whether link() 
follows the symbolic link, or creates a new link to the symbolic link itself."

In Linux, link() does _not_ follow symlinks 
(http://man7.org/linux/man-pages/man2/link.2.html):

  "By default, linkat(), does not dereference oldpath if it is a symbolic link 
(like link())."

But Python 3 assumes the opposite to be always the case:

  
https://github.com/python/cpython/blob/8cb65d1381b027f0b09ee36bfed7f35bb4dec9a9/Modules/posixmodule.c#L3517

...which suits e.g. NetBSD (https://netbsd.gw.com/cgi-bin/man-cgi?link+2):

  "When operating on a symlink, link() resolves the symlink and creates a hard 
link on the target."


Therefore, I recommend to always call linkat(), if the platform provides it. 
That's the modern superset of link() with clearly defined behavior.


Here are some commands to reproduce the issue on Linux (should hard link 'file' 
-> 'link', but tries '/tmp/symlink' -> 'link'):

~$ : >file
~$ ln -s "$PWD/file" /tmp/symlink
~$ strace -e link,linkat python -c 'import os; os.link("/tmp/symlink", "link", 
follow_symlinks=True)'
link("/tmp/symlink", "link")= -1 EXDEV (Cross-device link)
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 18] Cross-device link: '/tmp/symlink' -> 'link'
+++ exited with 1 +++


For comparison, calling linkat() without AT_SYMLINK_FOLLOW results in the same 
error:

~$ strace -e link,linkat python -c 'import os; os.link("/tmp/symlink", "link", 
follow_symlinks=False)'
linkat(AT_FDCWD, "/tmp/symlink", AT_FDCWD, "link", 0) = -1 EXDEV (Cross-device 
link)
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 18] Cross-device link: '/tmp/symlink' -> 'link'
+++ exited with 1 +++


Currently, the only way to call linkat() with AT_SYMLINK_FOLLOW from Python, is 
to provide a directory file descriptor != AT_FDCWD:

~$ strace -e link,linkat python -c 'import os; d=os.open(".", 0); 
os.link("/tmp/symlink", "link", dst_dir_fd=d, follow_symlinks=True)'
linkat(AT_FDCWD, "/tmp/symlink", 3, "link", AT_SYMLINK_FOLLOW) = 0
+++ exited with 0 +++

--
components: Library (Lib)
messages: 348086
nosy: jo-he
priority: normal
severity: normal
status: open
title: os.link(..., follow_symlinks=True) broken on Linux
type: behavior
versions: 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



[issue36390] IDLE: Move formatting functions into new format module.

2019-07-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The new PR moves the remaining Format functions to format.py.  I only edited 
enough to make things work.

I did not add tests for the 2 indent methods.  They only change future indents, 
leaving existing indents as it.  They need change, possibly elimination, in 
light of 3.x's prohibition mixed tab and space indents.  They make violation 
way too easy.  This PR will finish this issue.

--
title: IDLE: Refactor formatting methods from editor -> IDLE: Move formatting 
functions into new format module.

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-17 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +14621
pull_request: https://github.com/python/cpython/pull/14827

___
Python tracker 

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



[issue37521] importlib examples have their exec_module()/sys.modules assignment lines reversed

2019-07-17 Thread Brett Cannon


Brett Cannon  added the comment:

If you're using your example code for 'testext' that you uploaded then that's 
expected because the import in your package causes a normal import which means 
the import machinery is adding things to sys.modules. Try it with a plain 
module that's empty so you don't have any other imports as a side-effect of 
imports and you will see the module isn't added to sys.modules.

--

___
Python tracker 

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



[issue37608] _thread: acquire_lock, release_lock still in use while declared to be "gone" in Documentation

2019-07-17 Thread Brett Cannon


Brett Cannon  added the comment:

The documentation is correct by not documenting the methods as they are not 
meant to be used.

A warning could be added, but it requires new code to wrap the C function with 
a DeprecationWarning since that code is currently shared between 
thread.LockType.acquire() and acquire_lock().

--
components: +Library (Lib) -Documentation
nosy: +brett.cannon
type:  -> enhancement

___
Python tracker 

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



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

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14620
pull_request: https://github.com/python/cpython/pull/14826

___
Python tracker 

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



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

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14618
pull_request: https://github.com/python/cpython/pull/14824

___
Python tracker 

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



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

2019-07-17 Thread miss-islington


miss-islington  added the comment:


New changeset 8cb65d1381b027f0b09ee36bfed7f35bb4dec9a9 by Miss Islington (bot) 
(jpic) in branch 'master':
bpo-34155: Dont parse domains containing @ (GH-13079)
https://github.com/python/cpython/commit/8cb65d1381b027f0b09ee36bfed7f35bb4dec9a9


--
nosy: +miss-islington

___
Python tracker 

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



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

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14619
pull_request: https://github.com/python/cpython/pull/14825

___
Python tracker 

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



[issue33408] Enable AF_UNIX support in Windows

2019-07-17 Thread Paul Monson


Change by Paul Monson :


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

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-17 Thread Tal Einat


Tal Einat  added the comment:

Regarding validating integer inputs in the configuration dialog (E3), see my 
new PR GH-14822.

--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-17 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +14616
pull_request: https://github.com/python/cpython/pull/14822

___
Python tracker 

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



[issue33408] Enable AF_UNIX support in Windows

2019-07-17 Thread Paul Monson


Paul Monson  added the comment:

I don't know if datagram support is coming to AF_UNIX on Windows.

The changes will only add the flag on Windows, and will enable stream sockets 
to use AF_UNIX on Windows.  In mind this isn't breaking datagram support.  It 
is true that it's a subset of what appears to be supported on Linux/Unix.

--

___
Python tracker 

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



[issue37577] ModuleNotFoundError: No module named '_sysconfigdata__linux_x86_64-linux-gnu'

2019-07-17 Thread Matthias Klose


Matthias Klose  added the comment:

Luis, I'm still trying to figure out why you are seeing that. Please could you 
report the package versions which are installed on the system?

dpkg -l python3.7 python3.8 python3-distutils

--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-17 Thread Tal Einat


Tal Einat  added the comment:

Terry, on latest master (with the aforementioned PR merged), the context is 
updated quickly after the code-context is shown.  This happens after a delay of 
up to 100ms due to the update loop.

I've created PR GH-14821 with a fix.

--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-17 Thread Tal Einat


Change by Tal Einat :


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

___
Python tracker 

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



[issue37611] Improve the "Dealing with Bugs" documentation, include guidelines on how to report bugs

2019-07-17 Thread Mariatta


New submission from Mariatta :

On the left of docs.python.org, is a link to "Report a Bug", which takes you to 
"Dealing with Bugs" section (https://docs.python.org/3/bugs.html)

One of the first few paragraphs of the page is telling people that 
documentation bugs can be reported at the bug tracker, or if they're short on 
time, it can be emailed to d...@python.org. 

The next section is talking about "using issue tracker", and at the very bottom 
are two links to external resources about how to report bugs effectively and 
bug reporting guidelines.

1. It would be great if the guidelines are at the top, instead of the bottom.

2. It would be great if we provide our own set of guidelines, instead of 
linking to external resources.

I think the guidelines are especially important for people who opted to write 
an email instead of creating an issue in bpo. In bpo, user is kinda 
restricted/reminded to select a specific type/component, but writing email can 
be more freeform. The better email they write, the easier it is for us to 
respond to them.

--
assignee: docs@python
components: Documentation
messages: 348077
nosy: Mariatta, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Improve the "Dealing with Bugs" documentation, include guidelines on how 
to report bugs
type: enhancement

___
Python tracker 

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



[issue37521] importlib examples have their exec_module()/sys.modules assignment lines reversed

2019-07-17 Thread Benjamin Mintz


Benjamin Mintz  added the comment:

```
name = 'testext'

spec = importlib.util.find_spec(name)
print(name in sys.modules)
module = importlib.util.module_from_spec(spec)
print(name in sys.modules)
spec.loader.exec_module(module)
print(name in sys.modules)
```

This prints False, False, True though.

--

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-17 Thread Mariatta


Mariatta  added the comment:

Should have included the link, but I can't edit issue.
Here's the page which I think could be improved. 
https://docs.python.org/3/using/index.html

--

___
Python tracker 

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



[issue37610] Improve "Python Usage and Setup" documentation re: Editors & IDE

2019-07-17 Thread Mariatta


New submission from Mariatta :

The Python Usage and Setup documentation lists how to use Python in different 
environments: 
1. command line
2. Unix
3. Windows
4. MacOS

Under "Unix" environment there is a section for Editors and IDE, which actually 
links to external links like https://wiki.python.org/moin/PythonEditors that 
has more comprehensive list of editors across various platforms.

It would be great if the Editors & IDE section is not tied to the "Unix 
environment" section, which might got skipped if the reader is a Windows or Mac 
user. There are IDEs and Editors for those platforms too!

--
assignee: docs@python
components: Documentation
messages: 348074
nosy: Mariatta, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Improve "Python  Usage and Setup" documentation re: Editors & IDE
type: enhancement
versions: Python 2.7, 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



[issue33976] Enums don't support nested classes

2019-07-17 Thread Ethan Furman


Ethan Furman  added the comment:

Edward,

I'm inclined to agree with you.  It will take a couple versions for 
deprecation, etc., to push this through (assuming nobody comes up with a good 
counter-argument).

In the mean-time, this change has landed in aenum [1] so you can use it now.


[1] https://pypi.org/project/aenum/

--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-17 Thread miss-islington


miss-islington  added the comment:


New changeset 6816ca30af7705db691343100e696ea3d8f447d5 by Miss Islington (bot) 
in branch '3.8':
bpo-37461: Fix infinite loop in parsing of specially crafted email headers 
(GH-14794)
https://github.com/python/cpython/commit/6816ca30af7705db691343100e696ea3d8f447d5


--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-17 Thread miss-islington


miss-islington  added the comment:


New changeset 391511ccaaf0050970dfbe95bf2df1bcf6c33440 by Miss Islington (bot) 
in branch '3.7':
bpo-37461: Fix infinite loop in parsing of specially crafted email headers 
(GH-14794)
https://github.com/python/cpython/commit/391511ccaaf0050970dfbe95bf2df1bcf6c33440


--
nosy: +miss-islington

___
Python tracker 

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



[issue37491] IndexError in get_bare_quoted_string

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14614
pull_request: https://github.com/python/cpython/pull/14819

___
Python tracker 

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



[issue37491] IndexError in get_bare_quoted_string

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14613
pull_request: https://github.com/python/cpython/pull/14820

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14612
pull_request: https://github.com/python/cpython/pull/14818

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14611
pull_request: https://github.com/python/cpython/pull/14817

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-17 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:


New changeset a4a994bd3e619cbaff97610a1cee8ffa87c672f5 by Barry Warsaw 
(Abhilash Raj) in branch 'master':
bpo-37461: Fix infinite loop in parsing of specially crafted email headers 
(GH-14794)
https://github.com/python/cpython/commit/a4a994bd3e619cbaff97610a1cee8ffa87c672f5


--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14610
pull_request: https://github.com/python/cpython/pull/14816

___
Python tracker 

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



[issue36793] Do not define unneeded __str__ equal to __repr__

2019-07-17 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Serhiy: Did you plan to do any further work, or can this issue be closed?

--

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2019-07-17 Thread Elizabeth Uselton


Elizabeth Uselton  added the comment:

I feel like I agree with Paul here, unsurprising behavior from ANY is it 
matching anything, with no expectation that third party objects have to 
correctly have a return path for NotImplemented on their __eq__ method. ANY 
doesn't currently do that.

I've added a commit with couple other failing tests showing how using 
assertEqual is currently order sensitive when used with _Call or _CallList 
objects. I've got a work in progress fixing all three tests that just needs a 
little clean up, but think I might be able to lessen the complexity of it by 
adding Paul's idea of just special casing ANY directly, which may be smaller 
than the fix I have.

Thank you all for providing such great feedback so far, this is really 
interesting stuff to me, and a great first time submitting to Python experience 
so far.

--

___
Python tracker 

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



[issue37560] with cgi.FieldStorage(...) fails on cleanup with AttributeError, missing try/except in __exit__

2019-07-17 Thread Ngalim Siregar


Change by Ngalim Siregar :


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

___
Python tracker 

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



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2019-07-17 Thread Zackery Spytz


Zackery Spytz  added the comment:

Can this issue be closed? PR 7978 was merged and backported.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2019-07-17 Thread Nikolaus Rath


Nikolaus Rath  added the comment:

Is there a good reason to not explicitly initialize them nevertheless? Valgrind 
is a common tool, and this false positive will affect everyone attempting to 
run it on a Python extension module.

--

___
Python tracker 

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



[issue37337] Add _PyObject_VectorcallMethod() function

2019-07-17 Thread Zackery Spytz

Zackery Spytz  added the comment:

Commit b1263d5a60d3f7ab02dd28409fff59b3815a3f67 causes GCC 9.1.0 to give a 
warning in Objects/descrobject.c.

Objects/descrobject.c:1050:19: warning: cast between incompatible function 
types from ‘PyObject * (*)(mappingproxyobject *, PyObject * const*, 
Py_ssize_t)’ {aka ‘struct _object * (*)(struct  *, struct _object * 
const*, long int)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct 
_object * (*)(struct _object *, struct _object *)’} [-Wcast-function-type]
 1050 | {"get",   (PyCFunction)mappingproxy_get,METH_FASTCALL,
  |   ^

PR 14814 fixes this.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-17 Thread Guido Vranken


Guido Vranken  added the comment:

I used fuzzing to find this bug. After applying your patch, the infinite loop 
is gone and it cannot find any other bugs of this nature.

--

___
Python tracker 

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



[issue37337] Add _PyObject_VectorcallMethod() function

2019-07-17 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +14608
pull_request: https://github.com/python/cpython/pull/14814

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 093e9b1268f21624a09777818903f1088c674689 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.7':
bpo-36390: IDLE: Combine region formatting methods. (GH-12481) (GH-14812)
https://github.com/python/cpython/commit/093e9b1268f21624a09777818903f1088c674689


--

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 1fc43a3fafd22eb20832459654fd125f12aa3738 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.8':
bpo-36390: IDLE: Combine region formatting methods. (GH-12481) (GH-14811)
https://github.com/python/cpython/commit/1fc43a3fafd22eb20832459654fd125f12aa3738


--

___
Python tracker 

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



[issue37602] nonzero fixer problem

2019-07-17 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

I suspect these fixers were left out simply because no one expected anyone to 
call the dunder names directly; the whole point of the dunder names is that 
they're not used directly, being invoked by syntax/context (__nonzero__ being 
the first thing tried for implicit boolean testing or calls to 
bool/operator.truth) or by top-level functions (__oct__/__hex__ being called by 
oct/hex).

The only legitimate use case I can think of off-hand would be in class 
hierarchies, where a child dunder method is implemented in terms of a super() 
call to invoke the parent.

Do you have any examples of code bases that rely on this? I've never seen one 
personally, but I'm not about to claim exhaustive knowledge of all Python code 
in the world.

--
nosy: +josh.r

___
Python tracker 

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



[issue37491] IndexError in get_bare_quoted_string

2019-07-17 Thread Abhilash Raj


Change by Abhilash Raj :


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

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-07-17 Thread Abhilash Raj


Abhilash Raj  added the comment:

I have proposed a PR for this: https://github.com/python/cpython/pull/14794

Reviews are welcome.

--

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14606
pull_request: https://github.com/python/cpython/pull/14812

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14605
pull_request: https://github.com/python/cpython/pull/14811

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-07-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 82494aa6d947c4a320c09c58fe0f100cdcf7af0b by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-36390: IDLE: Combine region formatting methods. (GH-12481)
https://github.com/python/cpython/commit/82494aa6d947c4a320c09c58fe0f100cdcf7af0b


--

___
Python tracker 

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



[issue37597] audit event table breaks PDF sphinx build

2019-07-17 Thread Julien Palard


Julien Palard  added the comment:

Looks like a failure during library.pdf, from why we try to link to c-api.

In the sphinx latex builder:

if docname not in self.docnames:
raise NoUri

in self.docnames during the library build, we're only having library/* links. 
So c-api/code is obviously not in it.

--

___
Python tracker 

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



[issue37543] Optimize pymalloc for non PGO build

2019-07-17 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset fb26504d14a08fcd61bb92bb989b6d2b12188535 by Inada Naoki in branch 
'master':
bpo-37543: optimize pymalloc (#14674)
https://github.com/python/cpython/commit/fb26504d14a08fcd61bb92bb989b6d2b12188535


--

___
Python tracker 

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



[issue37543] Optimize pymalloc for non PGO build

2019-07-17 Thread Inada Naoki


Change by Inada Naoki :


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



[issue28569] mock.attach_mock should work with any return value of patch()

2019-07-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this similar to issue21478? Michael, can you please confirm this behavior 
and the change proposed in issue21478?

I tried out the below program as per initial report

# foo.py

from unittest.mock import patch, Mock
p = patch('requests.get', autospec=True)
manager = Mock()
manager.attach_mock(p.start(), 'requests_get')

import requests
requests.get('https://google.com')
print(manager.mock_calls)
p.stop()
print(manager.mock_calls)

# Without patch

$ python.exe foo.py
[]
[]

# With PR 14688 in issue21478

$ python.exe foo.py
[call.requests_get('https://google.com')]
[call.requests_get('https://google.com')]

--
nosy: +cjw296, mariocj89, xtreak
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



[issue37609] support "UNC" device paths in ntpath.splitdrive

2019-07-17 Thread Eryk Sun


New submission from Eryk Sun :

Windows Python includes UNC shares such as "//server/spam" in its definition of 
a drive. This is natural because Windows supports setting a UNC path as the 
working directory and handles the share component as the working drive when 
resolving rooted paths such as "/eggs". For the sake of generality when working 
with \\?\ extended paths, Python should expand its definition of a UNC drive to 
include "UNC" device paths.

A practical example is calling glob.glob with a "//?/UNC" device path.

>>> import os, sys, glob
>>> sys.addaudithook(lambda s,a: print('#', a[0]) if s == 'glob.glob' else 
None)

regular UNC path:

>>> glob.glob('//localhost/C$/Sys*')
# //localhost/C$/Sys*
['//localhost/C$/System Volume Information']

"UNC" device path:

>>> glob.glob('//?/UNC/localhost/C$/Sys*')
# //?/UNC/localhost/C$/Sys*
# //?/UNC/localhost/C$
# //?/UNC/localhost
# //?/UNC/
[]

Since the magic character "?" is in the path (IMO, the drive should be excluded 
from this check, but that's a separate issue), the internal function 
glob._iglob calls itself recursively until it reaches the base case of dirname 
== pathname, where dirname is from os.path.split(pathname). The problem here is 
that ntpath.split doesn't stop at the proper base case of 
"//?/UNC/localhost/C$". This is due to ntpath.splitdrive. For example:

>>> os.path.splitdrive('//?/UNC/localhost/C$/Sys*')
('//?/UNC', '/localhost/C$/Sys*')

>>> os.path.splitdrive('//./UNC/localhost/C$/Sys*')
('//./UNC', '/localhost/C$/Sys*')

The results should be "//?/UNC/localhost/C$" and "//./UNC/localhost/C$". 

In other cases, returning a device as the drive is fine, if not exactly 
meaningful (e.g. "//./NUL"). I don't think this needs to change.

--
components: Library (Lib), Windows
messages: 348055
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: support "UNC" device paths in ntpath.splitdrive
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



[issue34443] enum repr should use __qualname__

2019-07-17 Thread Walter Dörwald

Change by Walter Dörwald :


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

___
Python tracker 

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



[issue24231] os.makedirs('/', exist_ok=True) fails on Darwin

2019-07-17 Thread SilentGhost


Change by SilentGhost :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue37608] _thread: acquire_lock, release_lock still in use while declared to be "gone" in Documentation

2019-07-17 Thread 徐靖

New submission from 徐靖 :

In https://docs.python.org/3/whatsnew/3.0.html#library-changes Documentation, 
it said "Cleanup of the thread module: acquire_lock() and release_lock() are 
gone; use acquire() and release() instead."
But in 3.7, I can still find 
{"acquire_lock", (PyCFunction)(void(*)(void))lock_PyThread_acquire_lock,
 METH_VARARGS | METH_KEYWORDS, acquire_doc},
in _threadmodule.c line 217, which defined this function. And in my code ,these 
functions work, without any warning or error.
So maybe the Documentation should be changed, or the support of these functions 
should be removed, or at least add a warning.
It has no effect on code, but truly confusing and waste me an hour to search 
for why.

--
assignee: docs@python
components: Documentation
messages: 348053
nosy: docs@python, shiyuchong
priority: normal
severity: normal
status: open
title: _thread: acquire_lock,release_lock still in use while declared to be 
"gone" in Documentation
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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-17 Thread Tal Einat


Change by Tal Einat :


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



[issue37578] Change Glob: Allow Recursion for Hidden Files

2019-07-17 Thread myungsekyo


Change by myungsekyo :


--
nosy: +myungsekyo

___
Python tracker 

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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-17 Thread miss-islington


miss-islington  added the comment:


New changeset 6cf7c45cb5691b75d9a774c904df02a4f8bfcd04 by Miss Islington (bot) 
in branch '3.8':
bpo-37530: simplify, optimize and clean up IDLE code context (GH-14675)
https://github.com/python/cpython/commit/6cf7c45cb5691b75d9a774c904df02a4f8bfcd04


--

___
Python tracker 

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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-17 Thread miss-islington


miss-islington  added the comment:


New changeset bb79ab84c258566bcba89a87eb549fbc8643f882 by Miss Islington (bot) 
in branch '3.7':
bpo-37530: simplify, optimize and clean up IDLE code context (GH-14675)
https://github.com/python/cpython/commit/bb79ab84c258566bcba89a87eb549fbc8643f882


--
nosy: +miss-islington

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-17 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

One possible solution would be to have a macro to suppress the tp_print field 
in the first place. Something like

#ifndef PY_NO_TP_PRINT
/* bpo-37250: kept for backwards compatibility in CPython 3.8 only */
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
#endif

--

___
Python tracker 

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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14602
pull_request: https://github.com/python/cpython/pull/14808

___
Python tracker 

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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14601
pull_request: https://github.com/python/cpython/pull/14807

___
Python tracker 

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



[issue37530] IDLE: simplify, optimize, and clean up code context

2019-07-17 Thread Tal Einat


Tal Einat  added the comment:


New changeset 7036e1de3a87d36c7ef41b8a2b44ed6fc4d34be2 by Tal Einat in branch 
'master':
bpo-37530: simplify, optimize and clean up IDLE code context (GH-14675)
https://github.com/python/cpython/commit/7036e1de3a87d36c7ef41b8a2b44ed6fc4d34be2


--

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2019-07-17 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
pull_requests: +14600
pull_request: https://github.com/python/cpython/pull/14804

___
Python tracker 

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