[issue40841] Provide mimetypes.sniff API as stdlib

2020-07-27 Thread Jim Jewett


Jim Jewett  added the comment:

There are a zillion reasons a filename could be wrong -- but the standard
says to trust the filesystem.  So if it sniffs based on contents, it isn't
quite following the standard.  It is probably still a useful tool, but it
won't be the One Right Way, and it isn't even clear that it should replace
current heuristics.

On Mon, Jul 27, 2020 at 7:22 PM Guido van Rossum 
wrote:

>
> Guido van Rossum  added the comment:
>
> Whether the data was retrieved over a network has nothing to do with it.
>
> There are complementary ways of guessing what data you are working with --
> guess based on the filename extension or sniff based on the contents of the
> file (or downloaded data).
>
> There are a zillion reasons why the filename could be a lie -- e.g. a user
> could pick the wrong extension, or rename a file, or a tool could save a
> file using the wrong extension or no extension at all. Then again sometimes
> the contents of the file might not be enough, e.g.
> ```
> foo() // bar
> ```
> is both valid Python and valid JavaScript. :-)
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41345] Remote end closed connection without response

2020-07-27 Thread Martin Panter


Martin Panter  added the comment:

Previous report about Requests to the Python bug tracker: Issue 33620.

I suspect this is an unavoidable race condition with trying a POST (or other 
non-idempotent) request on an idle HTTP connection. I think it has to be up to 
the higher-level application or user to decide if it is safe to retry a POST 
request. Otherwise you risk e.g. accidentally ordering two pizzas because the 
server received two POST requests but something interfered with the response of 
the first response. On the other hand, I noticed some browsers seem to 
automatically retry a POST once if it is interrupted, which makes me uneasy.

A concrete example of the problem is a firmware upload that triggers a reboot. 
If the reboot is too quick and prevents the POST response being sent, I found 
that a web browser will repeat the firmware upload once more after my firmware 
boots up again.

If it is not safe to retry the POST request, other options would be to avoid 
the server thinking the connection is stale:

* always do the POST request on a fresh HTTP connection
* "ping" the connection with a dummy request (e.g. OPTIONS, HEAD, or GET) 
immediately before the POST request

Another option that comes to mind is to try using the 100 Continue mechanism, 
but this is not a general solution and depends on the application.

--
nosy: +martin.panter

___
Python tracker 

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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-27 Thread Dmytro Litvinov


Dmytro Litvinov  added the comment:

Hi Terry,

Seems like link to Academic Free License v. 
2.1(https://www.python.org/psf/contrib/) does not work. That link is mentioned 
at https://www.python.org/psf/contrib/ that you gave me.

Also, I have signed CLA before submitting PR as you wrote. From CLA bot at 
GitHub I see that I need to wait at least one business day. Should I wait for 
approval and then I could ping you one more time for reviewing patch?

--

___
Python tracker 

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



[issue41328] In unittest doc, replace Hudson CI with Travis and Appveyor

2020-07-27 Thread Dmytro Litvinov


Change by Dmytro Litvinov :


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

___
Python tracker 

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



[issue41409] deque.pop(index) is not supported

2020-07-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, the relationship between a concrete class and an ABC is normative with 
respect to core capabilities but isn't 100% strict.  Concrete classes can vary 
in small respects when it makes sense.  For example, the __or__ and __and__ 
methods for collections.Set will accept any iterable, but the concrete does 
not.  

We use the Liskov substitution principle as a guide, not as a law.  In a number 
of cases, we choose practicality-beats-purity and allow subclasses to differ in 
ways than their parents.  Counter() doesn't support fromkeys().  
OrderedDict.popitem() has different signature than dict.popitem().

Hope that insight was helpful.

--

___
Python tracker 

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



[issue19016] autospecced namedtuples should be truthy by default

2020-07-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2020-07-27 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

@Kyle Yes, msg373597 freebsd CURRENT buildbot passes, but freebsd 12/stable 
does not (cannot, since stable/12 wont get the syscall)

That means the Python memfd functions and tests need to account for this

--

___
Python tracker 

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



[issue41391] Make test_unicodedata pass when running without network

2020-07-27 Thread Jim Jewett


Jim Jewett  added the comment:

Looks Good To Me

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue41415] duplicated signature of dataclass in help()

2020-07-27 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


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

___
Python tracker 

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



[issue41415] duplicated signature of dataclass in help()

2020-07-27 Thread Sergey Fedoseev


New submission from Sergey Fedoseev :

In [191]: import dataclasses, pydoc

In [192]: @dataclass
 ...: class C:
 ...: pass
 ...:

In [193]: print(pydoc.render_doc(C))
Python Library Documentation: class C in module __main__

class C(builtins.object)
 |  C() -> None
 |
 |  C()
 |
 |  Methods defined here:
 |
 


It's duplicated because dataclass __doc__ defaults to signature:
 
In [195]: C.__doc__  
Out[195]: 'C()'

--
components: Library (Lib)
messages: 374461
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: duplicated signature of dataclass in help()
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2020-07-27 Thread Jim Jewett


Jim Jewett  added the comment:

Is it safe to say that there is an now intent to support VxWorks within the 
main tree, with Wind River agreeing to be primary support?

And this ticket has become a tracking ticket for the status on getting it 
there, small PR by small PR plus buildbot?

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-27 Thread Eryk Sun


Eryk Sun  added the comment:

I'm trying to give os.link() and follow_symlinks the benefit of the doubt, but 
the implementation just seems buggy to me. 

POSIX says that "[i]f 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" [1]. In Linux, link() does not follow symlinks. One has to call 
linkat() with AT_SYMLINK_FOLLOW:

AT_SYMLINK_FOLLOW (since Linux 2.6.18)
By default, linkat(), does not dereference oldpath if it is a 
symbolic link (like link()). The flag AT_SYMLINK_FOLLOW can be
specified in flags to cause oldpath to be dereferenced if it is
a symbolic link. 

The behavior is apparently the same in FreeBSD [2]. 

Thus the following implementation in os.link() seems buggy.

#ifdef HAVE_LINKAT
if ((src_dir_fd != DEFAULT_DIR_FD) ||
(dst_dir_fd != DEFAULT_DIR_FD) ||
(!follow_symlinks))
result = linkat(src_dir_fd, src->narrow,
dst_dir_fd, dst->narrow,
follow_symlinks ? AT_SYMLINK_FOLLOW : 0);
else
#endif /* HAVE_LINKAT */

The only way that the value of follow_symlinks matters in Linux is if 
src_dir_fd or dst_dir_fd is used with a real file descriptor (i.e. not 
DEFAULT_DIR_FD, which is AT_FDCWD). Otherwise, the default True value of 
follow_symlinks is an outright lie. For example:

>>> os.link in os.supports_follow_symlinks
True
>>> open('spam', 'w').close()
>>> os.symlink('spam', 'spamlink1')
>>> os.link('spamlink1', 'spamlink2')

spamlink2 was created as a hardlink to spamlink1, not its target, i.e. it's a 
symlink:
 
>>> os.lstat('spamlink1').st_ino == os.lstat('spamlink2').st_ino
True
>>> os.readlink('spamlink2')
'spam'

In contrast, if src_dir_fd is passed, then follow_symlinks=True is implemented 
as advertised (via AT_SYMLINK_FOLLOW):

>>> fd = os.open('.', 0)
>>> os.link('spamlink1', 'spamlink3', src_dir_fd=fd)

spamlink3 was created as a hardlink to spam, the target of spamlink1:
  
>>> os.lstat('spam').st_ino == os.lstat('spamlink3').st_ino
True

That the value of an unrelated parameter -- src_dir_fd -- changes the behavior 
of the follow_symlinks parameter is obviously a bug that should be addressed.

POSIX mandates that "[i]f both fd1 and fd2 have value AT_FDCWD, the behavior 
shall be identical to a call to link(), except that symbolic links shall be 
handled as specified by the value of flag". It's already using AT_FDCWD as a 
default value, so the implementation of os.link() should just unconditionally 
call linkat() if it's available. Then the value of follow_symlinks, true or 
false, will be honored, with or without passing src_dir_fd or dst_dir_fd.

That said, since os.link() hasn't been working as advertised, this change needs 
to be accompanied by changing the default value of follow_symlinks to False. 
That will retain the status quo behavior for most systems, except in the rare 
case that src_dir_fd or dst_dir_fd is used. If it isn't changed to False, then 
suddenly os.link() calls will start following symlinks, whereas prior to the 
change they did not because link() was being called instead of linkat(). 

--- 

In Windows, CreateHardLinkW [3] is incorrectly documented as following symlinks 
(i.e. "[i]f the path points to a symbolic link, the function creates a hard 
link to the target"). Actually, it opens the file to be hard-linked with the 
NTAPI option FILE_OPEN_REPARSE_POINT (same as WinAPI 
FILE_FLAG_OPEN_REPARSE_POINT). Thus no type of reparse point is followed, 
including symlinks.

---

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html
[2]: https://www.unix.com/man-page/FreeBSD/2/link
[3]: 
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createhardlinkw

--
nosy: +eryksun

___
Python tracker 

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



[issue18861] Problems with recursive automatic exception chaining

2020-07-27 Thread Martin Panter


Change by Martin Panter :


--
nosy: +martin.panter

___
Python tracker 

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



[issue41409] deque.pop(index) is not supported

2020-07-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This was an intentional decision.  Deques designed for fast access at the end 
points. Also, pop() is a core deque operation that needs to be fast.  Altering 
its signature with an optional argument would slow it down.

Thank you for the suggestion, but we really shouldn't do this.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
versions: +Python 3.10

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2020-07-27 Thread Kyle Evans


Kyle Evans  added the comment:

Hey koobs,

Can you confirm that this is fine now after I implemented SHM_GROW_ON_WRITE?

--

___
Python tracker 

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



[issue41413] IDLE: exit at input() prompt is not complete

2020-07-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Simpler test.

Open IDLE Shell (only) from icon or (preferably) terminal.
>>> input()
   # Close IDLE without giving input with Window (X), File => exit, or 
Control/Command-Q.
Click OK in "Your program is still running" box (from PyShell)

On Windows, IDLE closes apparently cleanly, but Task Manager shows that (at 
least usually) the IDLE process moves from Apps to Background processes, with 
label 'Python x.y.z Shell', where it remains as an inaccessible 20 mb zombie 
until [End Task]ed.  This is not normal.

On macOS Mohave, the Shell window and IDLE part of the top menubar disappear, 
but the Apple part remains with the apple and program name entry ("IDLE" or 
"Python" depending on whether started from icon or Terminal).  I presume this 
is the equivalent of Python becoming a background process, except that Apple 
keeps a visible link to it.  If I start IDLE in Terminal with trailing &, there 
are initially two processes, and the first remains along with the Apple menu.

Under the IDLE/Python menu item, About and Preferences still bring up the 
corresponding dialogs, which worked as far as I tested.  This confirms that the 
IDLE process is still alive. A couple of times, Quit (Command-Q) worked to 
quit/crash python, and Segmentation Fault appeared in Terminal once.  Later, 
Quit did not work and I had to use (apple)=> Force Quit.

The trivial solution is to not close with input pending.  First, either hit 
Enter to let the user code run or end-of-file (default ^D) to kill it.  A 
corresponding patch could enforce this with a message to enter or kill before 
closing.

However, I believe the issue is that PyShell.readline uses a nested tk 
mainloop() as a control mechanism.  Four callbacks, including eof_callback, 
call quit() to exit the nested mainloop and finish readline.  But the callback 
has to finish and be pulled off the stack first.  Three of the callbacks return 
immediately after 'quit()'.  However, PyShell.close continues closing before 
readline continues.

When I replaced pyshell line  1016
return EditorWindow.close(self)
with
root.after(1, EditorWindow.close self)
the bug disappears.  The opens a time gap between PyShell.close and 
EditorWindow.close that allows readline to return '', signalling end-of-file.

This change also works on my Mac, except that I have to say 'yes' twice to 
close.
Irv, please try this replacement on your system.

--
title: At prompt for input(), pressing Command q kills IDLE -> IDLE: exit at 
input() prompt is not complete

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-27 Thread wyz23x2


wyz23x2  added the comment:

Submmited PR 21651.

--

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-27 Thread wyz23x2


Change by wyz23x2 :


--
pull_requests: +20792
pull_request: https://github.com/python/cpython/pull/21651

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-27 Thread wyz23x2


wyz23x2  added the comment:

I agree it's more important.
Working.

--

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think it should be in a new section. But I'd put it as a 16.1.2 and push the 
others down. It seems like a more important piece of information than shebangs 
and startup files in interactive mode. Or maybe I'd even put it first.

That said, I'm not terribly great at writing documentation, so you might want 
some other opinions.

--

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-27 Thread wyz23x2


wyz23x2  added the comment:

If no one wants to work on it, I'll pick up that patch.
Should it be section 16.1.5? If not, what section should it fit into?

--

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think it should be mentioned in 
https://docs.python.org/3/tutorial/appendix.html#tut-interac, since that's the 
link that https://docs.python.org/3/tutorial/interpreter.html#interactive-mode 
uses for it's "for more information" link. This seems like a "more information" 
kind of thing, to me.

--

___
Python tracker 

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



[issue41394] Document '_' in interpreter tutorial

2020-07-27 Thread wyz23x2


Change by wyz23x2 :


--
title: Document '_' in interpreter in shell tutorial -> Document '_' in 
interpreter tutorial

___
Python tracker 

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



[issue41394] Document '_' in interpreter in shell tutorial

2020-07-27 Thread wyz23x2


wyz23x2  added the comment:

Submmited PR 21650. Should we also mention it in:
https://docs.python.org/3/tutorial/interpreter.html
or
https://docs.python.org/3/tutorial/appendix.html
?

(Matching the title of the issue)

--

___
Python tracker 

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



[issue41394] Document '_' in interpreter in shell tutorial

2020-07-27 Thread wyz23x2


Change by wyz23x2 :


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

___
Python tracker 

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



[issue41407] Tricky behavior of builtin-function map

2020-07-27 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Jim and Steven, so we'll mark this a closed.  

If you want to go forward, consider bringing this up on python-ideas.  If it 
gets a favorable reception, this can be re-opened.

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue41374] socket.TCP_* no longer available with cygwin 3.1.6+

2020-07-27 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 2.0 -> 3.0
pull_requests: +20789
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21649

___
Python tracker 

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



[issue41000] IDLE: only allow single instance

2020-07-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

We cannot prevent files being viewed and possibly modified by multiple programs 
and in general, should not.  I often open a file in more than one python 
version.  In any case, the proposed change would have a high chance on 
introducing bugs.  I just finished (I hope) repairing regressions in 3.8.4.  
And 

There are, however, two real issues.  One is being able to reload a file, 
either because it has been changed on disk or because one want to abandon edits 
since the last save.  The other is detecting when a file might need to be 
reloaded because of external changes.

Reloading is the subject of #1721083 (from 2007).  I just outlined a easy fix 
there. The hard part is adding tests for the affected method.  You can do that 
if you want, and say so before I do it.

Detecting file changes like Notepad++ does would be a different issue.

#38946 is about Catalina making incompatible changes in Apple graphics so that 
tcl/tk does not work as well as it does in Mohave.

To me, the main blocker for multiple tabs is separating editor frames with a 
text widget from editor windows with a menu.  And the need to refactor the 
hierarchy of text frames.  And to stop duplicating per class objects as per 
instance objects.

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



[issue41411] Improve and consolidate f-strings docs

2020-07-27 Thread Ezio Melotti


Change by Ezio Melotti :


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

___
Python tracker 

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



[issue1721083] Add File - Reload

2020-07-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Recent edits to iomenu.IOBinding.loadfile were intended to preserve the option 
of reloading a non-empty editor.

--
stage: patch review -> test needed

___
Python tracker 

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



[issue1721083] Add File - Reload

2020-07-27 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

All open files, up to the most recent 21 (and that could be increased) are in 
the recent file list.  Clicking on any name loads that file, unless it is 
already loaded.  The exception enforced in filelist.FileList.open, lines 29-32:

if key in self.dict:
edit = self.dict[key]
edit.top.wakeup()
return edit

I believe that we just need to ask, before the return, "Replace editor content 
with file content?" and if yes, call edit.io.loadfile(filename).

--
priority: low -> normal

___
Python tracker 

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



[issue41389] Garbage Collector Ignoring Some (Not All) Circular References of Identical Type

2020-07-27 Thread Tim Peters


Tim Peters  added the comment:

Well, this isn't a help desk ;-) You may want instead to detail your problem 
on, say, StackOverflow, or the general Python mailing list.

Please note that I don't know what your "problem" _is_:  you haven't said. You 
posted some numbers that didn't make sense to you, and made unwarranted 
extrapolations from those (for example, no, those numbers won't get worse if 
you let the program run a million times longer).

So you should spell out what the "real" problem is. This shows signs of being 
an "XY problem":

http://xyproblem.info/

For example, now you say:

> Calling gc.collect() on regular intervals doesn't seem
> to work consistently

That's news to me. The code you posted shows quite different behavior when 
FORCE_GC is set.

But if it's true that calling gc.collect() regularly doesn't alleviate "the 
real problem" (whatever that may be!), then that shows the opposite of what you 
appear to be assuming: that Python's cyclic gc is the root of the cause. 
collect() _will_ reclaim every scrap of RAM that's actually trash at the time 
it's called. So if calling that doesn't help, the problem is almost certainly 
NOT that trash isn't getting reclaimed. Something else is the cause.

Examples: it's not actually trash. It is, and gc collects it, but is unable to 
return it to the C library from which the memory came. It is returned to the C 
library, but that in turn is unable to return the memory to the OS. It is 
returned to the OS, but the OS decides to leave its virtual address space 
mapped to the process for now.

Details not only matter, they _can_ be everything when dealing with the 
multiple layers of memory management on modern machines. Waiting for a "general 
insight" is probably futile here :-(

--

___
Python tracker 

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



[issue1175686] add "reload" function to IDLE

2020-07-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> resolved

___
Python tracker 

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



[issue41407] Tricky behavior of builtin-function map

2020-07-27 Thread Jim Jewett


Jim Jewett  added the comment:

Why would you raise StopIteration if you didn't want to stop the nearest 
iteration loop?  I agree that the result of your sample code seems strange, but 
that is because it is strange code.

I agree with Steven D'Aprano that changing it would cause more pain than it 
would remove.

Unless it gets a lot more support by the first week of August, I recommend 
closing this request as rejected.

--
nosy: +Jim.Jewett
status: open -> pending

___
Python tracker 

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



[issue41405] python 3.9.0b5 test

2020-07-27 Thread YoSTEALTH


YoSTEALTH  added the comment:

I compiled and tested for same issues in 3.8.5 and they exist as well.

--

___
Python tracker 

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



[issue18280] Documentation is too personalized

2020-07-27 Thread Jim Jewett


Jim Jewett  added the comment:

I won't speak of nroff or troff in particular, but many programs had trouble 
distinguishing the end of a sentence from an honorific abbreviation, such as 
Mr. Spock or Dr. Seuss.

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-27 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
nosy: +pablogsal
nosy_count: 1.0 -> 2.0
pull_requests: +20787
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/21648

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks Ama Aje My Fren! You can transfer your other PR to a different bpo issue 
by editing the subject on GitHub.

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 3baff21f5bb8db7fa1c15788a8f82fa040a90d5d by Guido van Rossum in 
branch '3.8':
[3.8] bpo-41045: Document debug feature of f-strings ('=') (GH-21509) (#21647)
https://github.com/python/cpython/commit/3baff21f5bb8db7fa1c15788a8f82fa040a90d5d


--

___
Python tracker 

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



[issue40841] Provide mimetypes.sniff API as stdlib

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

Whether the data was retrieved over a network has nothing to do with it.

There are complementary ways of guessing what data you are working with -- 
guess based on the filename extension or sniff based on the contents of the 
file (or downloaded data).

There are a zillion reasons why the filename could be a lie -- e.g. a user 
could pick the wrong extension, or rename a file, or a tool could save a file 
using the wrong extension or no extension at all. Then again sometimes the 
contents of the file might not be enough, e.g.
```
foo() // bar
```
is both valid Python and valid JavaScript. :-)

--

___
Python tracker 

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



[issue41412] After installation on Windows7, 64bit Python 3.9.0b5 reports "api-ms-win-core-path-l1-1-0.dll" missing and doesn't start

2020-07-27 Thread Steve Dower


Steve Dower  added the comment:

I thought we already made it fail? (Checks) No we did not. Guess I 
misremembered that.

I'll fix this tomorrow. We need it, or else we'll be inundated with these 
reports for the entire life of 3.9.

--
assignee:  -> steve.dower
priority: normal -> release blocker
versions: +Python 3.10

___
Python tracker 

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



[issue40841] Provide mimetypes.sniff API as stdlib

2020-07-27 Thread Jim Jewett


Jim Jewett  added the comment:

The standard itself says that it only applies to content served over http; if 
the content is retrieved by ftp or from a file system, then you should trust 
that.  I don't notice that in the code you pointed to.

So maybe filetype is the right answer if the data isn't coming over the 
network?  For whatwg demonstration code, it is reasonable to assume that, but 
in python -- at a minimum, you should document the assumption prominently in 
the docs and docstring.

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue41406] BufferedReader causes Popen.communicate losing the remaining output.

2020-07-27 Thread Grégory Starck

Grégory Starck  added the comment:

also affecting 3.6

--
nosy: +g.sta...@gmail.com
versions: +Python 3.6

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +20786
pull_request: https://github.com/python/cpython/pull/21647

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset e962e3f65a086d9d3b848483fd01215d96ecc5f9 by Guido van Rossum in 
branch '3.9':
[3.9] bpo-41045: Document debug feature of f-strings ('=') (GH-21509) (GH-21645)
https://github.com/python/cpython/commit/e962e3f65a086d9d3b848483fd01215d96ecc5f9


--

___
Python tracker 

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



[issue38119] resource tracker destroys shared memory segments when other processes should still have valid access

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

@Davin, could you merge one or the other of the PRs that fix this? Presumably 
also backport to 3.9 and 3.8 (but that's up to you and the release manager).

--
nosy: +gvanrossum
versions: +Python 3.10

___
Python tracker 

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



[issue39959] Bug on multiprocessing.shared_memory

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

I declare this a duplicate of issue 38119.

--
nosy: +gvanrossum
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> resource tracker destroys shared memory segments when other 
processes should still have valid access

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +20785
pull_request: https://github.com/python/cpython/pull/21645

___
Python tracker 

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



[issue41409] deque.pop(index) is not supported

2020-07-27 Thread Jim Jewett


Jim Jewett  added the comment:

It may well have been intentional, as deques should normally be mutated only at 
the ends.  But Raymond did make changes to conform to the ABC, so this should 
probably be supported too.  Go ahead and include docstrings and/or discouraging 
it, though, except for i=0 and i=-1

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20784
pull_request: https://github.com/python/cpython/pull/21644

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread miss-islington


miss-islington  added the comment:


New changeset 13efaec2e03288d7ff0ee643589c32bde6c6973c by amaajemyfren in 
branch 'master':
bpo-41045: Document debug feature of f-strings ('=') (GH-21509)
https://github.com/python/cpython/commit/13efaec2e03288d7ff0ee643589c32bde6c6973c


--
nosy: +miss-islington

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think your PR 21552 and any work you're doing on pydoc could go under the new 
issue 41411 that Ezio just opened.

--

___
Python tracker 

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



[issue41405] python 3.9.0b5 test

2020-07-27 Thread Jim Jewett


Jim Jewett  added the comment:

Is this a platform where 3.8 was working?

The curses test seems to think you have too many color-pairs defined, and this 
might well be part of a semi-compatible curses library. I guess I would add 
some output to the test showing how many (and which) color pairs it thinks 
there are.

The pwd complaint is correct, but seems like it is complaining about the 
interface between python and your OS.

The tkinter problem is really a failure to round a floating point, and I would 
be surprised if python had made changes there recently.  I would be slightly 
less surprised if something in the compile chain of tk for your system 
hard-coded a specific rounding format.

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Ama Aje My Fren


Ama Aje My Fren  added the comment:

> then we can merge that one and close *this* issue.

I am looking at the pydoc issue now. It will take me more than an hour but I 
will figure it. Can that be under this issue also or (since you raised it as an 
OT) make that another issue?

--

___
Python tracker 

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



[issue41389] Garbage Collector Ignoring Some (Not All) Circular References of Identical Type

2020-07-27 Thread Ian O'Shaughnessy


Ian O'Shaughnessy  added the comment:

>I don't know of any language that guarantees all garbage will be collected 
>"right away". Do you?

I'm not an expert in this domain, so, no. I am however attempting to find a way 
to mitigate this issue. Do you have any suggestions how I can avoid these 
memory spikes? Weak references? Calling gc.collect() on regular intervals 
doesn't seem to work consistently.

--

___
Python tracker 

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



[issue41414] AST for arguments shows extra element

2020-07-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

(arg* posonlyargs) is correct and was added to 3.8 as part of 
https://www.python.org/dev/peps/pep-0570/

--
nosy: +pablogsal
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue41414] AST for arguments shows extra element

2020-07-27 Thread James Foster


New submission from James Foster :

https://docs.python.org/3.8/library/ast.html shows seven elements:
arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,
 expr* kw_defaults, arg? kwarg, expr* defaults)

https://docs.python.org/3.7/library/ast.html shows six elements:
arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,
 arg? kwarg, expr* defaults)

based on ast.c:1479 I believe that six is the proper number and that the first 
element ("arg* posonlyargs, ") is a duplicate of the second element ("arg* 
args, ") and should be removed.

--
assignee: docs@python
components: Documentation
messages: 374425
nosy: docs@python, jgfoster
priority: normal
severity: normal
status: open
title: AST for arguments shows extra element
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue41389] Garbage Collector Ignoring Some (Not All) Circular References of Identical Type

2020-07-27 Thread Tim Peters


Tim Peters  added the comment:

It's impossible for any implementation to know that cyclic trash _is_ trash 
without, in some way, traversing the object graph. This is expensive, so 
CPython (or any other language) does not incur that expense after every single 
decref that leaves a non-zero refcount (the one and only cheap clue that cyclic 
trash _may_ have just been created).

If you want/need synchronous behavior, avoid cycles. CPython's refcounting does 
dispose of trash the instant an object (not involved in a cycle) becomes trash. 
That behavior cannot be extended to cyclic trash short of (as above) running a 
cyclic gc pass extremely frequently.

I don't know of any language that guarantees all garbage will be collected 
"right away". Do you?  CPython does much more in that respect (due to primarily 
relying on refcounting) than most.

--

___
Python tracker 

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



[issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3

2020-07-27 Thread Howard A. Landman


Howard A. Landman  added the comment:

I'm running under 32-bit Raspbian, so let's assume the magic number is 13. 
There are only two places in my own code where the number 13 appears:

(1) My result_list is 14 items long, i.e. 0 to 13. Relevant code from qtd.py:
cum_results = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
...
while batches != 0:
...
result_list = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for m in range(ITERS):
...
result = tdc.measure(...)
result_list[result] += 1
...
for i in range(len(result_list)):
cum_results[i] += result_list[i]

I notice that result_list is getting thrown away each cycle, and thus must be 
garbage-collected. I could try changing that and see if it has any effect.

(2) in the tdc7201 library, 13 occurs as a possible (error) result code from 
measure(). However several of the failing runs had zero errors of this class, 
which means the code with 13 in it never got executed even once. I am not using 
pin 13 of the RPi's header, so I never send that number to RPi.GPIO. GPIO13 is 
pin 33 of the header, and I am not using that pin either, so I don't think 
RPi.GPIO is translating one of my pin number arguments to 13 internally. (But I 
should check Broadcom Mode numbers.)

--

___
Python tracker 

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



[issue41389] Garbage Collector Ignoring Some (Not All) Circular References of Identical Type

2020-07-27 Thread Ian O'Shaughnessy

Ian O'Shaughnessy  added the comment:

"Leak" was likely the wrong word.

It does appear problematic though.

The loop is using a fixed number of variables (yes, there are repeated dynamic 
allocations, but they fall out of scope with each iteration), only one of these 
variables occupies 1MB of ram (aside from the static variable).

The problem: There's only really one variable occupying 1MB of in-scope memory, 
yet the app's memory usage can/will exceed 1GB after extended use.

At the very least, this is confusing – especially given the lack of user 
control to prevent it from happening once it's discovered as a problem.

--

___
Python tracker 

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



[issue41405] python 3.9.0b5 test

2020-07-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The lnotab warning is probably a bug in gcc 10

--
nosy: +pablogsal

___
Python tracker 

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



[issue41405] python 3.9.0b5 test

2020-07-27 Thread YoSTEALTH


YoSTEALTH  added the comment:

>>> /opt/python/3.9.0/bin/python3 -m test.pythoninfo
Python debug information


CC.version: gcc (GCC) 10.1.0
Py_DEBUG: No (sys.gettotalrefcount() missing)
_decimal.__libmpdec_version__: 2.5.0
builtins.float.double_format: IEEE, little-endian
builtins.float.float_format: IEEE, little-endian
config[_config_init]: 2
config[_init_main]: 1
config[_install_importlib]: 1
config[_isolated_interpreter]: 0
config[_orig_argv]: ['/opt/python/3.9.0/bin/python3', '-m', 'test.pythoninfo']
config[_use_peg_parser]: 1
config[argv]: ['-m']
config[base_exec_prefix]: '/opt/python/3.9.0'
config[base_executable]: '/opt/python/3.9.0/bin/python3'
config[base_prefix]: '/opt/python/3.9.0'
config[buffered_stdio]: 1
config[bytes_warning]: 0
config[check_hash_pycs_mode]: 'default'
config[configure_c_stdio]: 1
config[dev_mode]: 0
config[dump_refs]: 0
config[exec_prefix]: '/opt/python/3.9.0'
config[executable]: '/opt/python/3.9.0/bin/python3'
config[faulthandler]: 0
config[filesystem_encoding]: 'utf-8'
config[filesystem_errors]: 'surrogateescape'
config[hash_seed]: 0
config[home]: None
config[import_time]: 0
config[inspect]: 0
config[install_signal_handlers]: 1
config[interactive]: 0
config[isolated]: 0
config[malloc_stats]: 0
config[module_search_paths]: ['/opt/python/3.9.0/lib/python39.zip', 
'/opt/python/3.9.0/lib/python3.9', 
'/opt/python/3.9.0/lib/python3.9/lib-dynload']
config[optimization_level]: 0
config[parse_argv]: 1
config[parser_debug]: 0
config[pathconfig_warnings]: 1
config[platlibdir]: 'lib'
config[prefix]: '/opt/python/3.9.0'
config[program_name]: '/opt/python/3.9.0/bin/python3'
config[pycache_prefix]: None
config[pythonpath_env]: None
config[quiet]: 0
config[run_command]: None
config[run_filename]: None
config[run_module]: 'test.pythoninfo'
config[show_ref_count]: 0
config[site_import]: 1
config[skip_source_first_line]: 0
config[stdio_encoding]: 'utf-8'
config[stdio_errors]: 'strict'
config[tracemalloc]: 0
config[use_environment]: 1
config[use_hash_seed]: 0
config[user_site_directory]: 1
config[verbose]: 0
config[warnoptions]: []
config[write_bytecode]: 1
config[xoptions]: []
datetime.datetime.now: 2020-07-27 14:03:42.099769
expat.EXPAT_VERSION: expat_2.2.8
fips.openssl_fips_mode: 0
gdb_version: GNU gdb (GDB) 9.2
gdbm.GDBM_VERSION: 1.18.1
global_config[Py_BytesWarningFlag]: 0
global_config[Py_DebugFlag]: 0
global_config[Py_DontWriteBytecodeFlag]: 0
global_config[Py_FileSystemDefaultEncodeErrors]: 'surrogateescape'
global_config[Py_FileSystemDefaultEncoding]: 'utf-8'
global_config[Py_FrozenFlag]: 0
global_config[Py_HasFileSystemDefaultEncoding]: 0
global_config[Py_HashRandomizationFlag]: 1
global_config[Py_IgnoreEnvironmentFlag]: 0
global_config[Py_InspectFlag]: 0
global_config[Py_InteractiveFlag]: 0
global_config[Py_IsolatedFlag]: 0
global_config[Py_NoSiteFlag]: 0
global_config[Py_NoUserSiteDirectory]: 0
global_config[Py_OptimizeFlag]: 0
global_config[Py_QuietFlag]: 0
global_config[Py_UTF8Mode]: 0
global_config[Py_UnbufferedStdioFlag]: 0
global_config[Py_VerboseFlag]: 0
global_config[_Py_HasFileSystemDefaultEncodeErrors]: 0
locale.encoding: UTF-8
os.cpu_count: 16
os.environ[DISPLAY]: :0
os.environ[HOME]: /home/stealth
os.environ[LANG]: en_CA.UTF-8
os.environ[LC_ADDRESS]: en_CA.UTF-8
os.environ[LC_IDENTIFICATION]: en_CA.UTF-8
os.environ[LC_MEASUREMENT]: en_CA.UTF-8
os.environ[LC_MONETARY]: en_CA.UTF-8
os.environ[LC_NAME]: en_CA.UTF-8
os.environ[LC_NUMERIC]: en_CA.UTF-8
os.environ[LC_PAPER]: en_CA.UTF-8
os.environ[LC_TELEPHONE]: en_CA.UTF-8
os.environ[LC_TIME]: en_CA.UTF-8
os.environ[PATH]: 
/home/stealth/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/opt/cuda/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
os.environ[SHELL]: /bin/bash
os.environ[TERM]: xterm-256color
os.getcwd: /home/stealth
os.getegid: 1000
os.geteuid: 1000
os.getgid: 1000
os.getgrouplist: 1000, 3, 7, 10, 90, 91, 93, 95, 96, 98, 619
os.getgroups: 3, 7, 10, 90, 91, 93, 95, 96, 98, 619, 1000
os.getloadavg: (0.26, 0.6, 0.59)
os.getrandom: ready (initialized)
os.getresgid: (1000, 1000, 1000)
os.getresuid: (1000, 1000, 1000)
os.getuid: 1000
os.login: stealth
os.name: posix
os.supports_bytes_environ: True
os.supports_effective_ids: ['access']
os.supports_fd: ['chdir', 'chmod', 'chown', 'execve', 'listdir', 'pathconf', 
'scandir', 'stat', 'statvfs', 'truncate', 'utime']
os.supports_follow_symlinks: ['access', 'chown', 'link', 'stat', 'utime']
os.umask: 0o022
os.uname: posix.uname_result(sysname='Linux', nodename='stealth', 
release='5.8.0-1-MANJARO', version='#1 SMP PREEMPT Sun Jul 26 22:13:04 UTC 
2020', machine='x86_64')
platform.architecture: 64bit ELF
platform.libc_ver: glibc 2.31
platform.platform: Linux-5.8.0-1-MANJARO-x86_64-with-glibc2.31
platform.python_implementation: CPython
pre_config[_config_init]: 2
pre_config[allocator]: 0
pre_config[coerce_c_locale]: 0
pre_config[coerce_c_locale_warn]: 0
pre_config[configure_locale]: 1

[issue41059] Large number of Coverity reports for parser.c

2020-07-27 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

I tried reprodicing the coverity results using cppcheck (I don't have access to 
the coverity project, someone needs to approve :() and I got just a dozen of 
results:

❯ cppcheck Parser/parser.c --enable=style
Checking Parser/parser.c ...
Parser/parser.c:3280:22: style: Condition '_res==NULL' is always false 
[knownConditionTrueFalse]
if (_res == NULL && PyErr_Occurred()) {
 ^
Parser/parser.c:3275:16: note: Assuming that condition 'a=_gather_33_rule(p)' 
is not redundant
(a = _gather_33_rule(p))  // ','.import_from_as_name+
   ^
Parser/parser.c:3279:20: note: Assignment '_res=a', assigned value is 0
_res = a;
   ^
Parser/parser.c:3280:22: note: Condition '_res==NULL' is always false
if (_res == NULL && PyErr_Occurred()) {
 ^
Parser/parser.c:3365:22: style: Condition '_res==NULL' is always false 
[knownConditionTrueFalse]
if (_res == NULL && PyErr_Occurred()) {
 ^
Parser/parser.c:3360:16: note: Assuming that condition 'a=_gather_36_rule(p)' 
is not redundant
(a = _gather_36_rule(p))  // ','.dotted_as_name+
   ^
Parser/parser.c:3364:20: note: Assignment '_res=a', assigned value is 0
_res = a;
   ^
Parser/parser.c:3365:22: note: Condition '_res==NULL' is always false
if (_res == NULL && PyErr_Occurred()) {
 ^
Parser/parser.c:6072:22: style: Condition '_res==NULL' is always false 
[knownConditionTrueFalse]
if (_res == NULL && PyErr_Occurred()) {
 ^
Parser/parser.c:6067:16: note: Assuming that condition 'a=_loop1_68_rule(p)' is 
not redundant
(a = _loop1_68_rule(p))  // (('@' named_expression NEWLINE))+
   ^
Parser/parser.c:6071:20: note: Assignment '_res=a', assigned value is 0
_res = a;
   ^
Parser/parser.c:6072:22: note: Condition '_res==NULL' is always false
if (_res == NULL && PyErr_Occurred()) {
 ^
Parser/parser.c:10662:22: style: Condition '_res==NULL' is always false 
[knownConditionTrueFalse]
if (_res == NULL && PyErr_Occurred()) {
 ^
Parser/parser.c:10657:16: note: Assuming that condition 'a=expression_rule(p)' 
is not redundant
(a = expression_rule(p))  // expression
   ^
Parser/parser.c:10661:20: note: Assignment '_res=a', assigned value is 0
_res = a;
   ^
Parser/parser.c:10662:22: note: Condition '_res==NULL' is always false
if (_res == NULL && PyErr_Occurred()) {

--

___
Python tracker 

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



[issue41000] IDLE: only allow single instance

2020-07-27 Thread E. Paine


E. Paine  added the comment:

Is it worth me developing a PR for this issue, as it may be a suitable fix for 
#38946? (I am not guaranteeing any code, though, but I will try). If not, I 
will probably close this issue.

--

___
Python tracker 

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



[issue40939] Remove the old parser

2020-07-27 Thread miss-islington


miss-islington  added the comment:


New changeset b3fbff7289176ba1a322e6899c3d4a04880ed5a7 by Lysandros Nikolaou in 
branch 'master':
bpo-40939: Remove even more references to the old parser (GH-21642)
https://github.com/python/cpython/commit/b3fbff7289176ba1a322e6899c3d4a04880ed5a7


--

___
Python tracker 

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



[issue40939] Remove the old parser

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset e6b2d93f0c3891827f609ecac1ced21e1626ed0a by Guido van Rossum in 
branch '3.9':
[3.9] bpo-40939: Use the new grammar for the grammar specification 
documentation (GH-19969) (#21641)
https://github.com/python/cpython/commit/e6b2d93f0c3891827f609ecac1ced21e1626ed0a


--

___
Python tracker 

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



[issue40939] Remove the old parser

2020-07-27 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20783
pull_request: https://github.com/python/cpython/pull/21642

___
Python tracker 

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



[issue41409] deque.pop(index) is not supported

2020-07-27 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Hi, I want to start contributing to CPython. Can I take up this issue?

Sure, go ahead. Feel free to ping one of us in the PR for review

--
nosy: +pablogsal

___
Python tracker 

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



[issue39959] Bug on multiprocessing.shared_memory

2020-07-27 Thread Diogo Flores


Diogo Flores  added the comment:

I have tried a different approach using https://gitlab.com/tenzing/shared-array 
and I got it to perform well on Linux. 
Basically, the code above places all numpy arrays in /dev/shm which allows you 
to access and modify them from any number of processes without creating any 
copies; for deleting is equally simple - The code provides a SharedArray.list() 
to list all objects that itself placed in /dev/shm and so one can just iterate 
over the list and delete each element. (An easier approach is to use PathLib 
and just unlik all shared memory objects in /dev/shm)

I guess a solution based on Mat's code could be adapted to try and solve  the 
shared-memory problems.

I look forward for further discussion on the subject.

Diogo

--

___
Python tracker 

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



[issue40939] Remove the old parser

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

The old parser is completely gone from the 3.10 branch. Closing.

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



[issue41413] At prompt for input(), pressing Command q kills IDLE

2020-07-27 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report. Actually this behavior is not specific to running IDLE 
on macOS, it's also reproducible on Linux and on all current versions of IDLE.

--
components:  -macOS
nosy:  -ronaldoussoren
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue40939] Remove the old parser

2020-07-27 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +20782
pull_request: https://github.com/python/cpython/pull/21641

___
Python tracker 

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



[issue41412] After installation on Windows7, 64bit Python 3.9.0b5 reports "api-ms-win-core-path-l1-1-0.dll" missing and doesn't start

2020-07-27 Thread Eryk Sun


Eryk Sun  added the comment:

> running python.exe results in an error message popup which tells me ...
> that the "api-ms-win-core-path-l1-1-0.dll" is missing on the computer. 
> I googled for it and it seems that this dll is not a part of Windows 7.

Microsoft ended extended support for Windows 7 back in January of this year, so 
Python 3.9 does not support Windows 7, in accordance with PEP 11 [1]. I'd 
expect the installer to fail on unsupported versions of Windows.

[1]: https://www.python.org/dev/peps/pep-0011/#microsoft-windows

--
nosy: +eryksun

___
Python tracker 

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



[issue40939] Remove the old parser

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 72cabb2aa636272e608285f5a6ba83b62be9be4e by Pablo Galindo in 
branch 'master':
bpo-40939: Use the new grammar for the grammar specification documentation 
(GH-19969)
https://github.com/python/cpython/commit/72cabb2aa636272e608285f5a6ba83b62be9be4e


--

___
Python tracker 

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



[issue41401] Using non-ascii that require UTF-8 breaks AIX testing

2020-07-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Automatic backport does not work due to changes in the test.support module. 
Victor, do you mind to backport PR 21640 to 3.9 and 3.8?

--
nosy: +vstinner

___
Python tracker 

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



[issue41362] Regenerating parser table fails (windows)

2020-07-27 Thread Constant Marks


Constant Marks  added the comment:

Thanks for the help.  I got my modification working by modifying the 
python.gram file and running build.bat --regen.

--

___
Python tracker 

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



[issue41413] At prompt for input(), pressing Command q kills IDLE

2020-07-27 Thread Irv Kalb


New submission from Irv Kalb :

This is probably related to earlier problems with running IDLE on MacOS 
Catalina:

Environment:

MacOS Catalina:  10.15.5
Python: 3.7.3
IDLE: 3.7.3

Steps to reproduce:

- Open IDLE, create a new file.  (Can reopen this file again for subsequent 
tests.)

- Code can consist of a single line:

dontCare = input('While this prompt for input is up, press Command q: ')

- Save and run

- When you see the prompt, press Command q to quit.

- See correct dialog box:  Your program is still running!  Do you want to kill 
it?

- Press OK.

Results:

- Python program quits.  Source file window closes. IDLE is left in an 
"unstable" state with only the IDLE menu option available.

At this point, any attempt to do anything with IDLE crashes IDLE, and shows a 
Mac system dialog box:

IDLE quit unexpectedly.  Click Reopen to open the application. Click Report to 
.


Note:  This is not a huge deal because I have to restart IDLE anyway because of 
a bug 38946, which does not allow me to allow me to double click on a Python 
file if IDLE is already running.  But I thought this new information might help 
track things down.



I have run in to this because I am correcting many student's homework files, 
where I ask them to build a loop where they ask the user for information, do 
some processing, and generate output with that information.  Then the loop goes 
around again and asks for input again.  I want to quit the application at that 
point, but I always end up crashing IDLE.

--
assignee: terry.reedy
components: IDLE, macOS
messages: 374407
nosy: IrvKalb, ned.deily, ronaldoussoren, terry.reedy
priority: normal
severity: normal
status: open
title: At prompt for input(), pressing Command q kills IDLE
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



[issue41401] Using non-ascii that require UTF-8 breaks AIX testing

2020-07-27 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 67987acd5dc9776f55f4e139e2b3d9e7a6434d9f by Serhiy Storchaka in 
branch 'master':
bpo-41401: Fix test_fspath_support in test_io. (GH-21640)
https://github.com/python/cpython/commit/67987acd5dc9776f55f4e139e2b3d9e7a6434d9f


--

___
Python tracker 

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



[issue38946] IDLE on macOS 10.15 Catalina does not open double-clicked files if app already launched

2020-07-27 Thread Irv Kalb


Irv Kalb  added the comment:

Right.  I'm struggling with this bug every day.

Irv

> On Jul 23, 2020, at 9:09 AM, Ned Deily  wrote:
> 
> 
> Ned Deily  added the comment:
> 
> Ramon, I am not sure why you closed this issue. Perhaps it may no longer be a 
> problem for you, but it has not yet been resolved for users of the python.org 
> macOS installers.
> 
> --
> stage: resolved -> 
> status: closed -> open
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41412] After installation on Windows7, 64bit Python 3.9.0b5 reports "api-ms-win-core-path-l1-1-0.dll" missing and doesn't start

2020-07-27 Thread Martin Borus


Martin Borus  added the comment:

Changed "component" from "resource" to "crash" because it seems to fit better.

--
type: resource usage -> crash

___
Python tracker 

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



[issue41412] After installation on Windows7, 64bit Python 3.9.0b5 reports "api-ms-win-core-path-l1-1-0.dll" missing and doesn't start

2020-07-27 Thread Martin Borus


New submission from Martin Borus :

I just installed Python 3.9.0b5 using the provided beta installer 
python-3.9.0b5-amd64 on a Windows7, 64bit machine.

I did the installation without the Py Launcher update, into the folder 
"c:\python39"

The installer finished without problem.

Running "cmd.exe", navigating to "c:\python39" and then running python.exe 
results in an error message popup which tells me in
German system language that the "api-ms-win-core-path-l1-1-0.dll" is missing on 
the computer. I googled for it and it seems that this dll is not a part of 
Windows 7.

Message:


---
python.exe - Systemfehler
---
Das Programm kann nicht gestartet werden, da api-ms-win-core-path-l1-1-0.dll 
auf dem Computer fehlt. Installieren Sie das Programm erneut, um das Problem zu 
beheben. 
---
OK   
---

--
components: Windows
messages: 374403
nosy: Martin Borus, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: After installation on Windows7, 64bit Python 3.9.0b5 reports 
"api-ms-win-core-path-l1-1-0.dll" missing and doesn't start
type: resource usage
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



[issue41411] Improve and consolidate f-strings docs

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

It's basically an accident that the only f-strings docs are in the language 
reference. Yes, they should be there, and the text there is pretty good *for 
the reference*, but there isn't much about them elsewhere outside of the 
tutorial, so everything links there. Maybe we need a section on them in the 
library part, of intermediate complexity between what's in the tutorial an 
what's in the reference. This could be on equal footing with the descriptions 
of % formatting and .format(), which seem to be quite extensive. We might also 
be able to share some text between .format() and f-strings, since the `!x` and 
`:...` parts are treated identically AFAICT. This would be another refactoring 
of some part of the docs.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue41406] BufferedReader causes Popen.communicate losing the remaining output.

2020-07-27 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2020-07-27 Thread Stefano Mazzucco


Stefano Mazzucco  added the comment:

Closing as this bug refers to versions of Python that have been EOL'd.

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



[issue41411] Improve and consolidate f-strings docs

2020-07-27 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think this is an excellent idea. The main f-string docs being in a section 
titled "Lexical Analysis" never seemed very user-friendly.

--

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Ezio Melotti


Ezio Melotti  added the comment:

> I agree that it might be better to separate them into a new issue.

I created #41411.

--

___
Python tracker 

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



[issue41411] Improve and consolidate f-strings docs

2020-07-27 Thread Ezio Melotti

New submission from Ezio Melotti :

[Creating a new issue from #41045]

I was just just trying to link to someone the documentation for f-strings, but:
1) Searching "fstring" only returns two results about xdrlib[0];
2) Searching "f-string" returns many unrelated results[1];
3) The first (and closer) result (string -- Common string operations[2]) yields 
nothing while using ctrl+f with fstring, f-string, f', f";
4) at the top of that page there are two links in a "see also":
  * Text Sequence Type — str[3]: it mentions raw strings at the beginning, but 
also yields no results for fstring, f-string, f', f";
  * String Methods[4]: that is another section of the previous page (so ctrl+f 
doesn't find anything), but has a link to "Format String Syntax"[5];
5) The "Format String Syntax" page[5] has another link in the middle of a 
paragraph that points to "formatted string literals", that eventually brings us 
to the right page[6];
6) the "right page"[6] has a wall of text with a block of code containing the 
grammar, luckily followed by a few examples.

I think we should:
1) add index entries for "f-string" and "fstring" in the relevant sections of 
the docs, so that they appear in the search result;
2) in the Text Sequence Type — str[3] section, have a bullet list for 
f-strings, raw-strings, and possibly u-strings;
3) possibly use the term "f-string" in addition (or instead) of "formatted 
string literal", to make the pages more ctrl+f-friendly throughout the docs;
4) possibly have another more newbie-friendly section on f-string (compared to 
the lexical analysis page) in the tutorial, in the stdtypes page[7] (e.g. 
before the printf-style String Formatting" section[8]), or in the string 
page[2] (e.g. after the "Format String Syntax" section[10]);
5) possibly reorganize and consolidate the different sections about strings, 
string methods, str.format(), the format mini-language, f-strings, 
raw/unicode-strings, %-style formatting in a single page or two (a page for the 
docs and one for the grammar), since it seems to me that over the years these 
sections got a bit scattered around as they were being added.

[0]: https://docs.python.org/3/search.html?q=fstring
[1]: https://docs.python.org/3/search.html?q=f-string
[2]: https://docs.python.org/3/library/string.html
[3]: https://docs.python.org/3/library/stdtypes.html#textseq
[4]: https://docs.python.org/3/library/stdtypes.html#string-methods
[5]: https://docs.python.org/3/library/string.html#formatstrings
[6]: https://docs.python.org/3/reference/lexical_analysis.html#f-strings
[7]: https://docs.python.org/3/library/stdtypes.html
[8]: 
https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting

--
assignee: docs@python
components: Documentation
messages: 374398
nosy: docs@python, eric.smith, ezio.melotti
priority: normal
severity: normal
stage: needs patch
status: open
title: Improve and consolidate f-strings docs
type: enhancement
versions: Python 3.10, 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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Guido van Rossum


Guido van Rossum  added the comment:

Those are really good observations and proposals, Ezio! I agree that it might 
be better to separate them into a new issue. Can you also review 
https://github.com/python/cpython/pull/21552 (the second PR here by 
amaajemyfren)? Maybe it would actually make a good candidate for part (4) of 
your proposed solutions.

@Ama Aje My Fren: please look at my review of 
https://github.com/python/cpython/pull/21509 and implement my suggestions, then 
we can merge that one and close *this* issue.

--

___
Python tracker 

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



[issue41408] Add a `clamp` function to the `math` module

2020-07-27 Thread Avinash Maddikonda


Avinash Maddikonda  added the comment:

Okay, I'm rejecting this issue. But please let me know/contribute if anyone is 
going to add a clamp function as a built-in method or a math module function.

--

___
Python tracker 

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



[issue41408] Add a `clamp` function to the `math` module

2020-07-27 Thread Avinash Maddikonda


Change by Avinash Maddikonda :


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



[issue38628] Issue with ctypes in AIX

2020-07-27 Thread David Edelsohn


David Edelsohn  added the comment:

Tony, Please see my reply from 2020-02-05.  This is a known "bug" in Python 
ctypes.  This is documented in Python ctypes.  This will not be fixed.  This 
cannot be fixed.

Python ctypes converts the array to a structure and creates an incorrect libffi 
descriptor.  The call to libffi creates a "fake" descriptor (description of the 
arguments) that doesn't match the actual data.  It cannot work.

This should be closed as "wont fix".

--

___
Python tracker 

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



[issue41045] f-string's "debug" feature is undocumented

2020-07-27 Thread Ezio Melotti

Ezio Melotti  added the comment:

I was just just trying to link to someone the documentation for f-strings, but:
1) Searching "fstring" only returns two results about xdrlib[0];
2) Searching "f-string" returns many unrelated results[1];
3) The first (and closer) result (string -- Common string operations[2]) yields 
nothing while using ctrl+f with fstring, f-string, f', f";
4) at the top of that page there are two links in a "see also":
  * Text Sequence Type — str[3]: it mentions raw strings at the beginning, but 
also yields no results for fstring, f-string, f', f";
  * String Methods[4]: that is another section of the previous page (so ctrl+f 
doesn't find anything), but has a link to "Format String Syntax"[5];
5) The "Format String Syntax" page[5] has another link in the middle of a 
paragraph that points to "formatted string literals", that eventually brings us 
to the right page[6];
6) the "right page"[6] has a wall of text with a block of code containing the 
grammar, luckily followed by a few examples.

I think we should:
1) add index entries for "f-string" and "fstring" in the relevant sections of 
the docs, so that they appear in the search result;
2) in the Text Sequence Type — str[3] section, have a bullet list for 
f-strings, raw-strings, and possibly u-strings;
3) possibly use the term "f-string" in addition (or instead) of "formatted 
string literal", to make the pages more ctrl+f-friendly throughout the docs;
4) possibly have another more newbie-friendly section on f-string (compared to 
the lexical analysis page) in the tutorial, in the stdtypes page[7] (e.g. 
before the printf-style String Formatting" section[8]), or in the string 
page[2] (e.g. after the "Format String Syntax" section[10]);
5) possibly reorganize and consolidate the different sections about strings, 
string methods, str.format(), the format mini-language, f-strings, 
raw/unicode-strings, %-style formatting in a single page or two (a page for the 
docs and one for the grammar), since it seems to me that over the years these 
sections got a bit scattered around as they were being added.

If you think this is out of the scope of this issue, I can open a separate one.

[0]: https://docs.python.org/3/search.html?q=fstring
[1]: https://docs.python.org/3/search.html?q=f-string
[2]: https://docs.python.org/3/library/string.html
[3]: https://docs.python.org/3/library/stdtypes.html#textseq
[4]: https://docs.python.org/3/library/stdtypes.html#string-methods
[5]: https://docs.python.org/3/library/string.html#formatstrings
[6]: https://docs.python.org/3/reference/lexical_analysis.html#f-strings
[7]: https://docs.python.org/3/library/stdtypes.html
[8]: 
https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting

--
nosy: +ezio.melotti
type:  -> enhancement

___
Python tracker 

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



[issue41408] Add a `clamp` function to the `math` module

2020-07-27 Thread Avinash Maddikonda


Avinash Maddikonda  added the comment:

So should I delete/reject this now? Because I think it would be more useful 
than functions like copysign (I mean copysign can be written easily without 
confusion, but clamp is confusing sometimes as the max function takes minimum 
and the min of value and the maximum, and yet we have a copysign function but 
not a clamp built-in or a math module function).

(I'll delete/reject if you guys want me to, np)

--

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-07-27 Thread Tony Reix


Tony Reix  added the comment:

Fedora32/x86_64 : Python v3.8.5 : optimized : uint type.

If, instead of using ulong type, the Pb.py program makes use of uint, the issue 
is different: see below.
This means that the issue depends on the length of the data.

BUILD=optimized
TYPE=int
export 
LD_LIBRARY_PATH=/opt/freeware/src/packages/BUILD/Python-3.8.5/build/optimized:/usr/lib64:/usr/lib
export 
PYTHONPATH=/opt/freeware/src/packages/BUILD/Python-3.8.5/build/optimized/Modules
./Pb-3.8.5-int-optimized.py
b'def'
None
None

# cat ./Pb-3.8.5-int-optimized.py
#!/opt/freeware/src/packages/BUILD/Python-3.8.5/build/optimized/python

# #!/opt/freeware/src/packages/BUILD/Python-3.8.5/python
#   #!/usr/bin/env python3

from ctypes import *

libc = CDLL('/usr/lib64/libc-2.31.so')

class MemchrArgsHack(Structure):
_fields_ = [("s", c_char_p), ("c", c_uint), ("n", c_uint)]

memchr_args_hack = MemchrArgsHack()
memchr_args_hack.s = b"abcdef"
memchr_args_hack.c = ord('d')
memchr_args_hack.n = 7

class MemchrArgsHack2(Structure):
_fields_ = [("s", c_char_p), ("c_n", c_uint * 2)]

memchr_args_hack2 = MemchrArgsHack2()
memchr_args_hack2.s = b"abcdef"
memchr_args_hack2.c_n[0] = ord('d')
memchr_args_hack2.c_n[1] = 7

print( CFUNCTYPE(c_char_p, c_char_p, c_uint, c_uint, c_void_p)(('memchr', 
libc))(b"abcdef", c_uint(ord('d')), c_uint(7), None))
print( CFUNCTYPE(c_char_p, MemchrArgsHack, c_void_p)(('memchr', 
libc))(memchr_args_hack, None))
print( CFUNCTYPE(c_char_p, MemchrArgsHack2, c_void_p)(('memchr', 
libc))(memchr_args_hack2, None))

--

___
Python tracker 

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



[issue41408] Add a `clamp` function to the `math` module

2020-07-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I will leave it to math module experts to keep it open or close it. There 
wasn't strong consensus on adding it math module either without a discussion in 
python-ideas https://bugs.python.org/msg358789.

--
nosy: +mark.dickinson, rhettinger, stutzbach

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-07-27 Thread Tony Reix


Change by Tony Reix :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue41394] Document '_' in interpreter in shell tutorial

2020-07-27 Thread Shubham Kumar Jha


Shubham Kumar Jha  added the comment:

The link provided by Karthikeyan Singaravelan doesn't mention that `_` would 
only get the not-None values. It is a part of interpreter and hence should be 
documented there. If no one is working on a patch, I would like to submit one.

--
nosy: +ShubhamKJha

___
Python tracker 

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



[issue38628] Issue with ctypes in AIX

2020-07-27 Thread Tony Reix


Tony Reix  added the comment:

Fedora32/x86_64 : Python v3.8.5 has been built.
Issue is still there, but different in debug or optimized mode.
Thus, change done in https://bugs.python.org/issue22273 did not fix this issue.

./Pb-3.8.5-debug.py :
#!/opt/freeware/src/packages/BUILD/Python-3.8.5/build/debug/python
...

i./Pb-3.8.5-optimized.py :
#!/opt/freeware/src/packages/BUILD/Python-3.8.5/build/optimized/python


BUILD=debug
export 
LD_LIBRARY_PATH=/opt/freeware/src/packages/BUILD/Python-3.8.5/build/debug:/usr/lib64:/usr/lib
export 
PYTHONPATH=/opt/freeware/src/packages/BUILD/Python-3.8.5/build/debug/Modules
./Pb-3.8.5-debug.py
b'def'
None
None

BUILD=optimized
export 
LD_LIBRARY_PATH=/opt/freeware/src/packages/BUILD/Python-3.8.5/build/optimized:/usr/lib64:/usr/lib
export 
PYTHONPATH=/opt/freeware/src/packages/BUILD/Python-3.8.5/build/optimized/Modules
+ ./Pb-3.8.5-optimized.py
b'def'
Pb-3.8.5.sh: line 6: 103569 Segmentation fault  (core dumped) 
./Pb-3.8.5-$BUILD.py

--

___
Python tracker 

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



[issue41408] Add a `clamp` function to the `math` module

2020-07-27 Thread Avinash Maddikonda


Avinash Maddikonda  added the comment:

Oh, I didn't know that. But I was thinking of adding it to the math module and 
not as a built-in method. I mean, it is definitely more useful than copysign, 
right?

--

___
Python tracker 

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



[issue40841] Provide mimetypes.sniff API as stdlib

2020-07-27 Thread Dong-hee Na


Dong-hee Na  added the comment:

> This looks like a useful addition. I hope someone will take up the review!

Thank you guido!
I also think that this API is good to be added to the standard library and it 
would be very useful!

I hope that someone would like to interest in this issue ;)

--

___
Python tracker 

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



  1   2   >