[issue40784] test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32

2020-05-26 Thread Petr Viktorin


Petr Viktorin  added the comment:

Indeed. The SQLite documentation talks about the limitations that 
non-deterministic functions have, not about deterministic functions being 
memoized: https://www.sqlite.org/deterministic.html

The flag would be better tested e.g. with a CHECK constraint: 
https://www.sqlite.org/lang_createtable.html#ckconst

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue40701] tempfile mixes str and bytes in an inconsistent manner

2020-05-26 Thread Eric L.


Eric L.  added the comment:

Well, your decision but, as a user of the library, it didn't feel like a new 
feature just like a bug to be fixed, the main issue being the inconsistent 
handling of bytes vs. str.

--

___
Python tracker 

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



[issue40701] tempfile mixes str and bytes in an inconsistent manner

2020-05-26 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 3.0 -> 4.0
pull_requests: +19698
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20442

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2020-05-26 Thread Michał Górny

Michał Górny  added the comment:

Do I understand correctly that the new behavior is intentional in 3.9, or is 
that still being discussed?

--
nosy: +mgorny

___
Python tracker 

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



[issue40734] /usr/bin surprisingly in sys.path under IDLE

2020-05-26 Thread paul rubin


paul rubin  added the comment:

Yes as mentioned I'm running Debian GNU/Linux, not Windows.  By "idle is 
installed in /usr/bin" I mean that it is an executable shell script stored at 
/usr/bin/idle .  Yes, shell prompt is the $ prompt to bash.  When I run 
"python3 -m idlelib", /usr/bin does not appear in sys.path.  "python -m 
idlelib" attempts to run python2 and I don't have python2 idle installed.  I'll 
see if I can figure out what's going on with sys.path in the user process.  The 
explanation about the two processes was helpful.  Thanks.

--

___
Python tracker 

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



[issue40789] C-level destructor in PySide2 breaks gen_send_ex, which assumes it's safe to call Py_DECREF with a live exception

2020-05-26 Thread Nathaniel Smith


New submission from Nathaniel Smith :

Consider the following short program. demo() is a trivial async function that 
creates a QObject instance, connects a Python signal, and then exits. When we 
call `send(None)` on this object, we expect to get a StopIteration exception.

-

from PySide2 import QtCore

class MyQObject(QtCore.QObject):
sig = QtCore.Signal()

async def demo():
myqobject = MyQObject()
myqobject.sig.connect(lambda: None)
return 1

coro = demo()
try:
coro.send(None)
except StopIteration as exc:
print(f"OK: got {exc!r}")
except SystemError as exc:
print(f"WTF: got {exc!r}")

-

Actual output (tested on 3.8.2, but I think the code is present on all 
versions):

-
StopIteration: 1
WTF: got SystemError(" returned NULL 
without setting an error")
-

So there are two weird things here: the StopIteration exception is being 
printed on the console for some reason, and then the actual `send` method is 
raising SystemError instead of StopIteration.

Here's what I think is happening:

In genobject.c:gen_send_ex, when the coroutine finishes, we call 
_PyGen_SetStopIterationValue to raise the StopIteration exception:

https://github.com/python/cpython/blob/404b23b85b17c84e022779f31fc89cb0ed0d37e8/Objects/genobject.c#L241

Then, after that, gen_send_ex clears the frame object and drops references to 
it:

https://github.com/python/cpython/blob/404b23b85b17c84e022779f31fc89cb0ed0d37e8/Objects/genobject.c#L266-L273

At this point, the reference count for `myqobject` drops to zero, so its 
destructor is invoked. And this destructor ends up clearing the current 
exception again. Here's a stack trace:

-
#0  0x00677eb7 in _PyErr_Fetch (p_traceback=0x7ffd9fda77d0, 
p_value=0x7ffd9fda77d8, p_type=0x7ffd9fda77e0, tstate=0x2511280)
at ../Python/errors.c:399
#1  _PyErr_PrintEx (tstate=0x2511280, set_sys_last_vars=1) at 
../Python/pythonrun.c:670
#2  0x7f1afb455967 in 
PySide::GlobalReceiverV2::qt_metacall(QMetaObject::Call, int, void**) ()
   from 
/home/njs/.user-python3.8/lib/python3.8/site-packages/PySide2/libpyside2.abi3.so.5.14
#3  0x7f1afaf2f657 in void doActivate(QObject*, int, void**) ()
   from 
/home/njs/.user-python3.8/lib/python3.8/site-packages/PySide2/Qt/lib/libQt5Core.so.5
#4  0x7f1afaf2a37f in QObject::destroyed(QObject*) ()
   from 
/home/njs/.user-python3.8/lib/python3.8/site-packages/PySide2/Qt/lib/libQt5Core.so.5
#5  0x7f1afaf2d742 in QObject::~QObject() ()
   from 
/home/njs/.user-python3.8/lib/python3.8/site-packages/PySide2/Qt/lib/libQt5Core.so.5
#6  0x7f1afb852681 in QObjectWrapper::~QObjectWrapper() ()
   from 
/home/njs/.user-python3.8/lib/python3.8/site-packages/PySide2/QtCore.abi3.so
#7  0x7f1afbf785bb in SbkDeallocWrapperCommon ()
   from 
/home/njs/.user-python3.8/lib/python3.8/site-packages/shiboken2/libshiboken2.abi3.so.5.14
#8  0x005a4fbc in subtype_dealloc (self=)
at ../Objects/typeobject.c:1289
#9  0x005e8c08 in _Py_Dealloc (op=) at 
../Objects/object.c:2215
#10 _Py_DECREF (filename=0x881795 "../Objects/frameobject.c", lineno=430, 
op=) at ../Include/object.h:478
#11 frame_dealloc (f=Frame 0x7f1afc572dd0, for file qget-min.py, line 12, in 
demo ())
at ../Objects/frameobject.c:430
#12 0x004fdf30 in _Py_Dealloc (
op=Frame 0x7f1afc572dd0, for file qget-min.py, line 12, in demo ())
at ../Objects/object.c:2215
#13 _Py_DECREF (filename=, lineno=279, 
op=Frame 0x7f1afc572dd0, for file qget-min.py, line 12, in demo ())
at ../Include/object.h:478
#14 gen_send_ex (gen=0x7f1afbd08440, arg=, exc=, 
closing=) at ../Objects/genobject.c:279

--

We can read the source for PySide::GlobalReceiverV2::qt_metacall here: 
https://sources.debian.org/src/pyside2/5.13.2-3/sources/pyside2/libpyside/globalreceiverv2.cpp/?hl=310#L310

And we see that it (potentially) runs some arbitrary Python code, and then 
handles any exceptions by doing:

if (PyErr_Occurred()) {
PyErr_Print();
}

This is intended to catch exceptions caused by the code it just executed, but 
in this case, gen_send_ex ends up invoking it with an exception already active, 
so PySide2 gets confused and clears the StopIteration.

---

OK so... what to do. I'm actually not 100% certain whether this is a CPython 
bug or a PySide2 bug.

In PySide2, it could be worked around by saving the exception state before 
executing that code, and then restoring it afterwards.

In gen_send_ex, it could be worked around by dropping the reference to the 
frame before setting the StopIteration exception.

In CPython in general, it could be worked around by not invoking deallocators 
with a live exception... I'm actually pretty surprised that this is even 
possible! It seems like having a live exception when you start executing 
arbitrary Python code would be bad. So maybe that's the real bug? Adding both 
"asyncio" and "memory management" interest groups to the nosy.


[issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Futrue

2020-05-26 Thread Kyle Stanley


Kyle Stanley  added the comment:

>From looking at the commit history of AbstactEventLoop.run_in_executor(), it 
>seems that it was previously be a non-coroutine method prior to the conversion 
>from the `@asyncio.coroutine` decorator to `async def` (PR-4753). See 
>https://github.com/python/cpython/blame/ede157331b4f9e550334900b3b4de1c8590688de/Lib/asyncio/events.py#L305.

The only context for the change I can find is the following conversation 
between Andrew and Yury: 
https://github.com/python/cpython/pull/4753#issuecomment-350114336. However, 
the example provided of `connect_read_pipe()` had already been a coroutine at 
the time for the BaseEventLoop implementation, which makes sense in that case. 
So, it's not clear to me as to why `run_in_executor()` was also converted to 
"async def" when its main implementation is not a coroutine. Furthermore, it's 
documented as an awaitable rather than a coroutine 
(https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor).

@Andrew do you have any additional context to provide that I'm potentially 
missing?

--
nosy: +aeros, asvetlov, yselivanov

___
Python tracker 

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



[issue40776] Python 3.7.6 installation issue on mac os x 10.6.8

2020-05-26 Thread Ned Deily


Ned Deily  added the comment:

Thanks for your report. Because of very low usage and the increasing difficulty 
of supporting new features and bug fixes on very old versions of macOS, like 
10.6.x, we no longer provide binary installers on python.org for macOS versions 
earlier than 10.9. On top of that, there was a specific problem with using the 
last several 10.6+ installers on 10.6 itself, due to changes in Apple packaging 
tools. This is the problem you are seeing and was first reported and tracked in 
Issue36890. As noted there, there is a link to a 3.7.4 installer that will work 
on macOS 10.6. However, we do not recommend you use it as the most recent 
release of Python 3.7 is now 3.7.7 with the final bugfix release of 3.7.x 
coming next month; Python 3.8.3 is now current.

Instead, if you expect to continue using 10.6 Snow Leopard, I would strongly 
suggest you look at installing Python(s) from the MacPorts project.  They do an 
excellent job of providing up-to-date versions of open source software, like 
Python, for multiple versions of macOS, including 10.6. They have pre-built 
packages of the most recent versions of python37 and python38 for 10.6.  See 
https://www.macports.org/install.php#installing for a link to their base 
package installer for 10.6. You can then install Python with:

sudo port selfupdate
sudo port install python37
or
sudo port install python38

Many third-party Python packages have also been ported and pre-built. You can 
search for them with:

sudo port search py37  # (or py38)

or on their website at https://ports.macports.org

Good luck!

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> python-3.7.3-macosx10.6.pkg verification error on macOS 10.6 
Snow Leopard
type: compile error -> 

___
Python tracker 

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



[issue40762] Writing bytes using CSV module results in b prefixed strings

2020-05-26 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

On further thought, no, I don't think it would be a reasonable feature.

User opens the CSV file, probably using the default encoding (UTF-8?) 
but potentially in anything.

They collect some data as bytes. Those bytes could be from any unknown 
encoding. When they try writing those bytes to the CSV file, at best 
they get an explicit but confusing exception that the decoding failed, 
at worst they get data loss (mojibake).

# Latin-1 to UTF-8 fails
py> b = 'ßæ'.encode('latin-1')
py> b.decode('utf-8')
# raises UnicodeDecodeError: 'utf-8' codec can't decode 
# byte 0xdf in position 0: invalid continuation byte

# UTF-8 to Latin-1 loses data
py> b = 'ßæ'.encode('UTF-8')
py> b.decode('latin-1')
# returns mojibake 'Ã\x9fæ'

Short of outright banning the use of bytes (raise a TypeError), I think 
the current behaviour is least-worst.

--

___
Python tracker 

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



[issue40784] test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32

2020-05-26 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

This seems like it's testing an implementation detail.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue40788] Build issue Solaris 10 Sparc

2020-05-26 Thread Warren Hardy


New submission from Warren Hardy :

I am using Solaris 10 (last oracle release). GCC 5.5.0

I had trouble with _ssl not building it was failing out with sethostname 
reference

I fixed this by removing the  -Werror=implicit-function-declaration

My main issue is that _ctypes is not being built and I am not sure why. I have 
googled for an answer, I have not found one. 

please can somebody explain simply how I rectify this problem. 

Thank you in advanced

--
assignee: christian.heimes
components: SSL, ctypes
messages: 370041
nosy: christian.heimes, munocat
priority: normal
severity: normal
status: open
title: Build issue Solaris 10 Sparc
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



[issue40762] Writing bytes using CSV module results in b prefixed strings

2020-05-26 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

The csv file object knows the encoding it was opened with, I think?

If so, we could add an enhancement that bytes objects are first decoded to str 
using the same encoding the file was opened with. That seems like a reasonable 
new feature to me.

Everything else would continue to be passed through str().

--
nosy: +steven.daprano
type: behavior -> enhancement

___
Python tracker 

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



[issue40787] Mysql + unittest crash

2020-05-26 Thread Lucas


New submission from Lucas :

environment: win10 cmd, python 3.8 32-bit, mysql, unittest

description: When restoring a database through mysql in a unittest function, 
the command prompt freezes before giving the result of the test, and I am 
forced to close it to quit.

steps to replicate: Have mysql installed, create a database with some content, 
dump the latter in a file, create a unit test using python's unittest with at 
least two test functions, and restore the file in one of them.

--
components: Library (Lib)
messages: 370039
nosy: lgerosa
priority: normal
severity: normal
status: open
title: Mysql + unittest crash
type: crash
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



[issue40779] incorrect end column for single argument generator function call AST

2020-05-26 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-05-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Researching 'nested mainloop': the one we are concerned with is in 
pyshell.PyShell.readline, currently line 1078.

self.top.mainloop()  # nested mainloop()

This was in David Scherer's 'Initial Revision' of 2000 Aug 14 without the 
comment.  It has since been touched once to add the comment.

2004 Dec 22, KBK, 5c3df35b6b1f48cb48c91b0c7a8754590a694171.
The GUI was hanging if the shell window was closed while a raw_input() was 
pending.  Restored the quit() of the readline() mainloop().
http://mail.python.org/pipermail/idle-dev/2004-December/002307.html

So no hint of reason.
---

https://stackoverflow.com/questions/17252056/tkinter-nested-mainloop
OP asked about using a nested mainloop for a video player.  There is discussion 
(dispute) of whether or not this blocked the mainloop.  Tkinter expert Bryan 
Oakley opined "While it's possible, there is very rarely ever a need to call 
it. reason to do it, and what you are trying to do probably won't work the way 
you think it will. –" 

OP Raoul quoted FL "Event loops can be nested; it's ok to call mainloop from 
within an event handler." (dead link to draft version). It is now in mainloop 
entry of https://effbot.org/tkinterbook/widget.htm.  There is no explanation of 
why or what effect.
---

Mark Lutz, Programming Python, discusses recursive mainloop calls as an 
alternative way to make modal dialogs, without 'wait' and other setup calls.  
In the 3rd edition, displayed by Google Books, the half page is expanded to a 
full page (442-443, Example 9-14, PP3E/Gui/Tour/dlg-recursive.py) and he adds 
that calling quit() is mandatory (see KBK patch above) and that using 'wait', 
etc, is 'probably better'.  The latter is what IDLE does.  Since 'modal' means 
'disable event handling outside the dialog', the intent must be to suspend the 
outer event loop, as we see for this issue.
---

While I still think that IDLE should protect user code input in response to 
*IDLE's* '>>>' prompt, even more than it does now, I now agree that IDLE should 
not do the same with try user *input()* calls.  The usability of the latter is 
the responsibility of users who write them.

Not blocking thread prints may just be a matter of removing mainloop() and all 
corresponding quit() calls.  Proper sequencing may be trickier.  Tem4.py calls 
input() and print() from both main and thread.  Run directly with 3.9.0b1, it 
results in

thread start
main input: m  # wait before entering 'm\n'.
main got:  m
thread input: t
thread got:  t

What surprised me is 'thread input:' being held up until 'main got' was 
printed.  Run from IDLE, the result is

thread startmain input: 
m
thread input: main got: t
 thread got: m 
t

This is more jumbled, not less.  'main input:' is printed before the '\n' after 
'thread start'.  etc.  Separating print(...input()) into two statements had no 
effect.  Neither did removing sleep(.1).  We will have to retest after blocking 
is removed.

--
Added file: https://bugs.python.org/file49194/tem4.py

___
Python tracker 

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



[issue16995] Add Base32 support for RFC4648 "Extended Hex" alphabet (patch attached)

2020-05-26 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00
nosy_count: 6.0 -> 7.0
pull_requests: +19697
pull_request: https://github.com/python/cpython/pull/20441

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

To my knowledge, dataclasses works with `from __future__ import annotations`. 
If there are specific examples of problems, I'd like to hear about it: please 
open a separate issue.

There is a hack (discussed at PyCon 2018 with all of the relevant players) 
where it avoids importing typing to look at typing.ClassVar, but I think that 
code is all correct. Maybe I should just bite the bullet and import typing, 
since I believe importing it is faster than it used to be.

--

___
Python tracker 

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



[issue40786] madvise should be accessible outside of mmap instance

2020-05-26 Thread Enji Cooper


Change by Enji Cooper :


--
components: +Library (Lib)

___
Python tracker 

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



[issue40786] madvise should be accessible outside of mmap instance

2020-05-26 Thread Enji Cooper


New submission from Enji Cooper :

madvise can be used when manipulating mmap'ed pages, but it can also be used 
when protecting processes and other things.

Having madvise be available in mmap as a function would be helpful instead of 
having to jump through a lot of hoops to run `MADV_PROTECT` on a process.

--
messages: 370036
nosy: ngie
priority: normal
severity: normal
status: open
title: madvise should be accessible outside of mmap instance
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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

- Double forward ref: IMO this can be resolved in the get_type_hints() 
functions. (Łukasz do you agree?)

- inspect.signature(): Maybe this could switch to using 
typing.get_type_hints()? Then again if performance is important here maybe we 
cannot change anything.

- dataclasses hacks: these should just be resolved.

Another thought: maybe some of these issues can be considered bugs in 3.9 as 
well, and we should fix them there too? That might help us decide the right 
path forward. After all we should really encourage people to start using `from 
__future__ import annotations` in their code, to help them get ready for these 
issues in 3.10.

Final thought: I know at least the Dropbox client team, and possibly also 
Instagram, has already turned on `from __future__ import annotations` by 
default in their local fork of Python. Maybe we can ask them if they ever felt 
the need to change inspect.signature or typing.get_type_hints.

--

___
Python tracker 

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



[issue40654] shutil.copyfile mutates symlink for absolute path

2020-05-26 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

What do you think about readlink returning something like:

class Link(str):
  print_name = None  # type: str | None

  @property
  def friendly_name(self) -> str:
return self.print_name or self

os.readlink would always return one of these Link objects, and since it's a 
substr, it would behave the way it currently behaves, but with an additional 
property. This approach would expose the underlying duality of the "name" of a 
link or junction, such that tools that need a friendly name could use 
.friendly_name and tools that need to inspect the print name could do that... 
but for the cases that wish for the most precise target could use the default 
value.

--

___
Python tracker 

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



[issue40611] Add MAP_POPULATE to the mmap library

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Ethan Steinberg, the constant is added to 3.10.

Sadly, adding a new constant is a new feature, and we don't add new features to 
stable branches. The 3.9 branch no longer accept new features past the feature 
freeze which is over. In the meanwhile, you can hardcode the constant, but its 
value may depend on the platform, be careful!

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



[issue40611] Add MAP_POPULATE to the mmap library

2020-05-26 Thread STINNER Victor


Change by STINNER Victor :


--
versions: +Python 3.10 -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



[issue40611] Add MAP_POPULATE to the mmap library

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 21fda91f8da96406e6a912f7c312424209c19bef by Ethan Steinberg in 
branch 'master':
bpo-40611: Adds MAP_POPULATE to the mmap module (GH-20061)
https://github.com/python/cpython/commit/21fda91f8da96406e6a912f7c312424209c19bef


--
nosy: +vstinner

___
Python tracker 

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



[issue34689] Lib/sysconfig.py expands non-variables

2020-05-26 Thread Erwan Le Pape


Change by Erwan Le Pape :


--
pull_requests: +19696
pull_request: https://github.com/python/cpython/pull/20439

___
Python tracker 

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



[issue20928] xml.etree.ElementInclude does not include nested xincludes

2020-05-26 Thread Shantanu


Change by Shantanu :


--
nosy: +hauntsaninja
nosy_count: 8.0 -> 9.0
pull_requests: +19695
pull_request: https://github.com/python/cpython/pull/20438

___
Python tracker 

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



[issue33187] Document ElementInclude (XInclude) support in ElementTree

2020-05-26 Thread Shantanu


Change by Shantanu :


--
nosy: +hauntsaninja
nosy_count: 6.0 -> 7.0
pull_requests: +19694
pull_request: https://github.com/python/cpython/pull/20438

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

> The second problem is `inspect.signature`. If we don't resolve annotations 
> there and continue it is definitely going to break some code.

Would you mind to elaborate why would it break some code? Consumers of 
annotations should already be prepared to get directly types or strings, no?

> If we resolve, that would mean that annotations must able to point something 
> real (and this might not be the real case if the user uses a string 
> annotation etc.) and will break code. (both tried and both breaks different 
> modules on the stdlib tests)

I expect that resolving has an impact on performance, whereas the caller may 
not use annotations at all but only cares of the number of parameters or their 
name.

It would be resonable to not resolve annotations in signature() by default. If 
someone cares, maybe a new parameter can be added to resolve annotations?

--

___
Python tracker 

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



[issue40785] `mmap.mmap(..., 0)` doesn't work as advertised in docs (fails with EINVAL); relies on compatibility behavior no longer permitted by [some] Unix OSes

2020-05-26 Thread Enji Cooper


Enji Cooper  added the comment:

Sidenote: all versions tested were 3.8.2:

pinklady:freebsd ngie$ /usr/local/opt/python@3.8/bin/python3 -V
Python 3.8.2

--

___
Python tracker 

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



[issue40785] `mmap.mmap(..., 0)` doesn't work as advertised in docs (fails with EINVAL); relies on compatibility behavior no longer permitted by [some] Unix OSes

2020-05-26 Thread Enji Cooper


New submission from Enji Cooper :

The documentation for mmap.mmap() claims that passing a length of 0 will map in 
an entire file, but unfortunately that doesn't work as shown below:

>>> mmap.mmap(-1, 0)
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 22] Invalid argument

I've double-checked that this isn't an OS specific bug on the following OS 
platforms:

* Fedora 31
* FreeBSD 
* OSX Catalina

The errno == EINVAL issue is documented in the OS X Catalina manpage as follows:

```
 [EINVAL]   The len argument was negative or zero. Historically, 
the system call would not return an error if the argument was zero.  See other 
potential additional
restrictions in the COMPATIBILITY section below.

...

COMPATIBILITY
 mmap() now returns with errno set to EINVAL in places that historically 
succeeded.  The rules have changed as follows:

 o   The flags parameter must specify either MAP_PRIVATE or MAP_SHARED.

 o   The len parameter must not be 0.

 o   The off parameter must be a multiple of pagesize, as returned by 
sysconf().
```

POSIX concurs: https://pubs.opengroup.org/onlinepubs/9699919799/ .

So, in short -- python's mmap.mmap(.., 0) implementation relies on behavior 
which is now not permitted in multiple OSes and is not permitted per the POSIX 
spec for mmap(2).

1. https://docs.python.org/3/library/mmap.html#mmap.mmap

--
components: Interpreter Core
messages: 370029
nosy: ngie
priority: normal
severity: normal
status: open
title: `mmap.mmap(..., 0)` doesn't work as advertised in docs (fails with 
EINVAL); relies on compatibility behavior no longer permitted by [some] Unix 
OSes
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



[issue40780] float.__format__() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Eric V. Smith

Change by Eric V. Smith :


--
title: str.format() handles trailing zeros inconsistently in “general” format 
-> float.__format__() handles trailing zeros inconsistently in “general” format

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

After trying to complete a patch, there are a few issues that immediately 
showed itself (and this might lead to not to do this in 3.10, I dont know);

First one is double-forward-ref, which is usage of string-annotations when 
there is postponed evaluatation of annotations:
>>> import typing
>>> from __future__ import annotations
>>> def x(a: 'int'): pass
... 
>>> typing.get_type_hints(x)
{'a': ForwardRef('int')}

If we make annoatations feature default, this would be default behavior. The 
solution would be a workaround to the compiler;
static int
compiler_visit_annexpr(struct compiler *c, expr_ty annotation)
{
if (annotation->kind == Constant_kind && 
PyUnicode_CheckExact(annotation->v.Constant.value)) {
PyObject *text = annotation->v.Constant.value;
Py_INCREF(text);
ADDOP_LOAD_CONST_NEW(c, text);
} else {
ADDOP_LOAD_CONST_NEW(c, _PyAST_ExprAsUnicode(annotation));
}
return 1;
}
But I am not sure if this is too silly or not. 

The second problem is `inspect.signature`. If we don't resolve annotations 
there and continue it is definitely going to break some code. If we resolve, 
that would mean that annotations must able to point something real (and this 
might not be the real case if the user uses a string annotation etc.) and will 
break code. (both tried and both breaks different modules on the stdlib tests)

The third problem is various dataclass hacks. Like `_type_{field.name}` etc. 
annotations and how ClassVar/InitVar parsed.

There are also some little parts that need to change. 

Any thoughts on these issues?

--

___
Python tracker 

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



[issue37824] IDLE: Handle Shell input warnings properly.

2020-05-26 Thread Tal Einat


Change by Tal Einat :


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



[issue37999] No longer use implicit convertion to int with loss

2020-05-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +19693
pull_request: https://github.com/python/cpython/pull/20437

___
Python tracker 

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



[issue16954] Add docstrings for ElementTree module

2020-05-26 Thread Chitrank-Dixit


Chitrank-Dixit  added the comment:

I would like to work on this issue, I found this open and needs a patch.

--
nosy: +Chitrank-Dixit

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think I'd just do 3.9 and master. It does seem subtle for a minor release, 
when people are less likely to be looking at the release notes.

--

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

I'm wondering how far back the fix should be backported. Clearly it should go 
into the 3.9 branch as well as master, but it feels like the sort of fix where 
the behaviour change resulting from the fix is as likely to break code as the 
bug itself.

--

___
Python tracker 

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



[issue40784] test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I also tried with a function taking one argument and then call it twice by 
running "SELECT deterministic(1)" query twice: again, the mock is also called 
twice.

--

___
Python tracker 

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



[issue40771] python3 fromtimestamp generates OSError

2020-05-26 Thread SilentGhost


SilentGhost  added the comment:

I think I would have to leave judgement on that to core developers. This, if 
accepted, would be a candidate for 3.10.

--
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue40784] test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32

2020-05-26 Thread STINNER Victor


New submission from STINNER Victor :

With SQLite 3.32, test_sqlite fails with:

FAIL: CheckFuncDeterministic (sqlite3.test.userfunctions.FunctionTests)
--
Traceback (most recent call last):
  File 
"/builddir/build/BUILD/Python-3.9.0b1/Lib/sqlite3/test/userfunctions.py", line 
290, in CheckFuncDeterministic
self.assertEqual(mock.call_count, 1)
AssertionError: 2 != 1

This test defines a "deterministic" function and ensures that calling it twice 
in SQLite with only call the underyling Python function only once.

Copy of the test:

@unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "deterministic 
parameter not supported")
def CheckFuncDeterministic(self):
mock = unittest.mock.Mock(return_value=None)
self.con.create_function("deterministic", 0, mock, deterministic=True)
self.con.execute("select deterministic() = deterministic()")
self.assertEqual(mock.call_count, 1)

In pysqlite_connection_create_function() of Modules/_sqlite/connection.c, 
determistic=1 sets the following flag:

flags |= SQLITE_DETERMINISTIC;

This flag is documented as:
"A deterministic function always gives the same answer when it has the same 
inputs."

* https://www.sqlite.org/deterministic.html
* https://www.sqlite.org/c3ref/c_deterministic.html

"SELECT 1 WHERE deterministic() = deterministic()" query also calls the mock 
twice.

Running "SELECT deterministic()" query twice also calls the mock twice.

It seems like SQLite 3.32 behaves differently.

Fedora issue: https://bugzilla.redhat.com/show_bug.cgi?id=1839826

--
components: Tests
messages: 370022
nosy: ghaering, vstinner
priority: normal
severity: normal
status: open
title: test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32
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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

The PR is ready for review.

--

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

I opened the PR 20434 as draft, but from what I understand, there is going to 
be some breakage (on our test suite). I'll try to narrow it down (currently ~4 
tests instead of ~20) but I dont want to prevent anyone else from working on 
this, so feel free to ignore my PR if you have a working test suite with a low 
breakage level.

--

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
Removed message: https://bugs.python.org/msg370003

___
Python tracker 

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



[issue40753] Remove Python 2 compatibility code from pathlib

2020-05-26 Thread Brett Cannon


Brett Cannon  added the comment:

If you can't find the guidance then please either open an issue or submit a PR 
to update the devguide with the info.

As for why your other PR was accepted, that was fixing an actual bug in the 
docstring. This one has absolutely no semantic change to Python; it's the 
equivalent of changing some whitespace just because it isn't quite in line with 
PEP 8. It simply isn't worth the overhead of the PR review or the churn on the 
file as now the `git blame` info is off for who last made a semantic change to 
that line.

--

___
Python tracker 

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



[issue40783] test_interpreters test_interpreters leaked [216, 216, 216] references

2020-05-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ok, closing as duplicate although I prefer to track the leaks in different 
issues for organizational pourposes.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue40783] test_interpreters test_interpreters leaked [216, 216, 216] references

2020-05-26 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Yes, We can track it under here: https://bugs.python.org/issue32604#msg369454

Following up when my schedule improves this week.

--

___
Python tracker 

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



[issue40781] Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS environment variable

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

> Please, don't remove these as I use them often to track down memory usage in 
> a similar way as Inada-san.

Ok, sure. I close my issue and I closed my PR.

Note: Maybe your advanced usage of statistics on memory allocators should be 
documented somewhere in https://devguide.python.org/.

--
resolution:  -> not a bug
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



[issue40783] test_interpreters test_interpreters leaked [216, 216, 216] references

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

Issue already reported at https://bugs.python.org/issue32604#msg369454

--

___
Python tracker 

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



[issue40783] test_interpreters test_interpreters leaked [216, 216, 216] references

2020-05-26 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
assignee:  -> nanjekyejoannah

___
Python tracker 

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



[issue40783] test_interpreters test_interpreters leaked [216, 216, 216] references

2020-05-26 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

https://buildbot.python.org/all/#/builders/394/builds/94

..
test_interpreters leaked [216, 216, 216] references, sum=648
test_interpreters leaked [84, 84, 84] memory blocks, sum=252
1 test failed again:
test_interpreters

--
components: Tests
messages: 370014
nosy: eric.snow, nanjekyejoannah, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: test_interpreters test_interpreters leaked [216, 216, 216] references
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



[issue40781] Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS environment variable

2020-05-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Please, don't remove these as I use them often to track down memory usage in a 
similar way as Inada-san.

--

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

Created a PR with a tentative fix. It still needs regression tests; working on 
those.

--

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Mark Dickinson


Change by Mark Dickinson :


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

___
Python tracker 

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



[issue40771] python3 fromtimestamp generates OSError

2020-05-26 Thread Jim Carroll


Jim Carroll  added the comment:

My bad. I read the docs, but mistakenly believed platform support meant OS. I 
figured since Windows maketh then Windows should taketh. I've spent the day 
studying the _datetimemodule.c code and now realize my error.

Question -- it seems to me an unnecessary limitation.  If someone were willing 
to submit a platform neutral version of localtime/gmtime that worked 
identically on all platforms, would this be met with eagerness? Or more of a 
shoulder shrug?

It's a fair amount of effort, and I'm willing to commit to it, but if the issue 
only matters to me, I can work around it.

--

___
Python tracker 

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



[issue40778] Updating Py_REFCNT and Py_SIZE to use _PyObject_CAST_CONS

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

Should be fixed by https://github.com/python/cpython/pull/20429

--

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

For completeness, here's the output using just format, which I prefer over 
str.format because there's less going on: it removes all of the str.format 
machinery and basically directly calls obj.__format__.

>>> format(1504, '.3g')
'1.5e+03'
>>> format(1505, '.3g')
'1.50e+03'
>>> format(1506, '.3g')
'1.51e+03'

--

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue40781] Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS environment variable

2020-05-26 Thread Inada Naoki


Inada Naoki  added the comment:

I use it often when I investigate memory usage.
It provides some useful information even in release Python build. For example:

* Which size class is most allocated?
* How many block are allocated?
* Which size class have most free blocks? (e.g. Inner fragmentation)
* Combined with tracing application to stderr, which part of the application 
increase memory usage?

--

___
Python tracker 

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



[issue40781] Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS environment variable

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

> I use it often when I investigate memory usage.

Oh. If you use it, we should keep the feature :-)

--

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

This appears to go all the way down to _Py_dg_dtoa, which in mode 3 is supposed 
to suppress trailing zeros.

I'll dig in and see if I can find a fix. (Assigning to me so that I don't 
forget it, but I also don't want to block anyone else - if anyone else feels 
like working on this, please do go ahead.)

--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-05-26 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +19690
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/20433

___
Python tracker 

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



[issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Futrue

2020-05-26 Thread James Barrett


New submission from James Barrett :

As discussed in < 
https://github.com/python/typeshed/issues/3999#issuecomment-634097968 > the 
type of `AbstractEventLoop.run_in_executor` is defined at < 
https://github.com/python/cpython/blob/master/Lib/asyncio/events.py#L286 > as 
follows:

```
async def run_in_executor(self, executor, func, *args):
raise NotImplementedError
```

However all concrete implementations of this method are actually not async 
methods but rather synchronous methods which return a Future object.

Logically this appears to make sense: at base `run_in_executor` is not a 
coroutine, since it doesn't create an object representing code which will be 
executed when the object is awaited, rather it returns an object representing 
code which is running asynchronously elsewhere (on another thread) and which 
can be awaited to wait for that other thread to complete its task. Which seems 
to be a perfect match to what a Future object is supposed to be.

As such it seems that the current definition of the method as a coroutine is 
possibly a mistake.

Alternatively if some feel that it is important to allow concrete 
implementations to implement it as a coroutine if they need to then perhaps it 
could be specified to be a method returning an Awaitable, since that would 
cover both options?

--
components: Library (Lib)
messages: 370005
nosy: jamesba
priority: normal
severity: normal
status: open
title: AbstactEventLoop.run_in_executor is listed as an async method, but 
should actually return a Futrue
type: behavior
versions: Python 3.10, 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



[issue37999] No longer use implicit convertion to int with loss

2020-05-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 578c3955e0222ec7b3146197467fbb0fcfae12fe by Serhiy Storchaka in 
branch 'master':
bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)
https://github.com/python/cpython/commit/578c3955e0222ec7b3146197467fbb0fcfae12fe


--

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

I'm starting it if anyone else already prepared a patch.

--

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

Very interesting. Agreed that this looks like a bug. It affects old-style 
formatting, too:

>>> "%.3g" % 1503
'1.5e+03'
>>> "%.3g" % 1504
'1.5e+03'
>>> "%.3g" % 1505
'1.50e+03'

--
versions: +Python 3.10, 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



[issue19500] ftplib: Add client-side SSL session resumption

2020-05-26 Thread Florian Wickert


Florian Wickert  added the comment:

Using vsftpd 3.0.3 with ssl_enable=YES and require_ssl_reuse=YES I get the 
following error when I try to upload a file with conn.storbinary():

FTP command: Client "192.168.178.115", "STOR something.bin"
FTP response: Client "192.168.178.115", "150 Ok to send data."
FTP response: Client "x.x.x.x", "150 Ok to send data."
DEBUG: Client "x.x.x.x", "DATA connection terminated without SSL shutdown. 
Buggy client! Integrity of upload cannot be asserted."
FTP response: Client "x.x.x.x", "426 Failure reading network stream."

This also happens when SSL reuse is disabled on the server side.
Uploading with FileZilla works and there is basically no difference in the log 
until the error happens.

--
nosy: +Florian Wickert

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread STINNER Victor


Change by STINNER Victor :


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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

Is there anyone interested to implement this change in Python 3.10?

--

___
Python tracker 

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



[issue40601] [C API] Hide static types from the limited C API

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

> Technically, it is not, see 
> https://www.python.org/dev/peps/pep-0384/#structures
> Structures like PyLong_Type are *not* part of the limited API.

The symbol is exported by libpython:

$ objdump -T /lib64/libpython3.8.so.1.0|grep PyLong_Type
0030de00 gDO .data  01a0  BasePyLong_Type

A C extension can use a reference to PyLong_Type.

> I don't think it's necessary here.

Did you read my rationale (first message)? Do you mean that per-interpreter GIL 
is not worth it?

--

A first step would be to expose "CheckExact" macros as function calls in the 
limited C API.

--

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-05-26 Thread miss-islington


miss-islington  added the comment:


New changeset 1c88bf8541e6fa292f1578144add17d3672c5fcf by Miss Islington (bot) 
in branch '3.9':
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
https://github.com/python/cpython/commit/1c88bf8541e6fa292f1578144add17d3672c5fcf


--

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-05-26 Thread miss-islington


miss-islington  added the comment:


New changeset 285ff63351bb5a42099527c283f65434e761be83 by Miss Islington (bot) 
in branch '3.8':
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
https://github.com/python/cpython/commit/285ff63351bb5a42099527c283f65434e761be83


--

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Eric V. Smith


Eric V. Smith  added the comment:

FWIW, which is probably not much with ".g" formatting, this is how Decimal 
behaves:

>>> from decimal import Decimal as D
>>> format(D(1504), '.3g')
'1.50e+3'
>>> format(D(1505), '.3g')
'1.50e+3'
>>> format(D(1506), '.3g')
'1.51e+3'
>>> format(D(1504.0), '.3g')
'1.50e+3'
>>> format(D(1505.0), '.3g')
'1.50e+3'
>>> format(D(1506.0), '.3g')
'1.51e+3'
>>> format(D("1504.0"), '.3g')
'1.50e+3'
>>> format(D("1505.0"), '.3g')
'1.50e+3'
>>> format(D("1506.0"), '.3g')
'1.51e+3'

--

___
Python tracker 

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue40781] Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS environment variable

2020-05-26 Thread STINNER Victor


New submission from STINNER Victor :

I never used sys._debugmallocstats() function or PYTHONMALLOCSTATS environment 
variable, whereas I spend significant time on optimizing memory allocators and 
free lists. The output is written into stderr which is very convenient to 
process these data.

I only "re"-discovered recently this debug feature when writing PR 20247 "Make 
tuple free list per-interpreter": I had to update _PyTuple_DebugMallocStats().

Removing this debug feature reduces the maintenance burden.

Attached PR removes all code related to the sys._debugmallocstats() function 
and the PYTHONMALLOCSTATS environment variable.

If someone wants to hack Python memory allocators or free lists, I suggest to 
add temporary code to dump some stats. But I don't think that it's worth it to 
keep the feature for all uses in Python.

People who worry about the memory usage of their application don't have to go 
into this low level of details, but care more about memory peak, where the 
memory was allocated (ex: tracemalloc module), RSS memory, etc.

--
components: Interpreter Core
messages: 369987
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS 
environment variable
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



[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-05-26 Thread Tal Einat


Tal Einat  added the comment:

Can someone talk about the reasoning behind the nested Tk mainloop? I haven't 
managed to find anything useful in code comments and such. Guido?

--

___
Python tracker 

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



[issue40781] Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS environment variable

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

"Recent" changes in builtin Python debug tools.

* In Python 3.9, I removed the "COUNT_ALLOCS" special build: bpo-39489.

* Debug build of Python 3.8 is now ABI compatible with release build: I 
disabled Py_TRACE_REFS macro by default in --with-pydebug build. There is a new 
opt-in --with-trace-refs option for configure. We have a dedicated buildbot to 
ensure that the feature continue to work.

* In Python 3.8, I modified the debug hooks on Python memory allocators to omit 
the serial number by default. It reduces the memory footprint when these hooks 
are used (1 size_t per memory block). Extract of Objects/obmalloc.c:

/* Uncomment this define to add the "serialno" field */
/* #define PYMEM_DEBUG_SERIALNO */

--

___
Python tracker 

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



[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-05-26 Thread Tal Einat


Tal Einat  added the comment:

This seems to be at least partly intentional: When waiting for user input, IDLE 
starts a nested Tk mainloop (!), which is stopped by the end-of-line handler. 
It seems to me that this is what is causing displaying other outputs to be 
delayed.

--

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-05-26 Thread Tal Einat


Tal Einat  added the comment:

Thanks for fixing this, Ido!

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



[issue40756] Second argument of LoggerAdapter.__init__ should default to None

2020-05-26 Thread miss-islington


miss-islington  added the comment:


New changeset 8ad052464a4e0aef9a11663b80f187087b773592 by Arturo Escaip in 
branch 'master':
bpo-40756: Default second argument of LoggerAdapter.__init__ to None (GH-20362)
https://github.com/python/cpython/commit/8ad052464a4e0aef9a11663b80f187087b773592


--
nosy: +miss-islington

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-05-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +19688
pull_request: https://github.com/python/cpython/pull/20431

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-05-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19689
pull_request: https://github.com/python/cpython/pull/20432

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-05-26 Thread Tal Einat


Tal Einat  added the comment:


New changeset db098bc1f05bd0773943e59f83489f05f28dedf8 by idomic in branch 
'master':
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
https://github.com/python/cpython/commit/db098bc1f05bd0773943e59f83489f05f28dedf8


--

___
Python tracker 

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



[issue40781] Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS environment variable

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

INADA-san, Antoine, Serhiy, Pablo: did any of you used this feature recently? 
Is it useful for your hacks?

--
nosy: +inada.naoki, pablogsal, pitrou, serhiy.storchaka

___
Python tracker 

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



[issue40781] Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS environment variable

2020-05-26 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40779] incorrect end column for single argument generator function call AST

2020-05-26 Thread Tomasz Pytel


Tomasz Pytel  added the comment:

I am on 3.8.1 and you are right this is the same as #39235 so please disregard.

--

___
Python tracker 

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



[issue40779] incorrect end column for single argument generator function call AST

2020-05-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

For more context, see also bpo-39235.

--

___
Python tracker 

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



[issue39244] multiprocessing.get_all_start_methods() wrong default on macOS

2020-05-26 Thread Tal Einat


Change by Tal Einat :


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



[issue40779] incorrect end column for single argument generator function call AST

2020-05-26 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

What version are you using, 3.8?

--

___
Python tracker 

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



[issue39573] [C API] Make PyObject an opaque structure in the limited C API

2020-05-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19686
pull_request: https://github.com/python/cpython/pull/20429

___
Python tracker 

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



[issue40778] Updating Py_REFCNT and Py_SIZE to use _PyObject_CAST_CONS

2020-05-26 Thread Dong-hee Na


Dong-hee Na  added the comment:

Victor will convert the macros to the functions.
So this change will be included in his PR.

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



[issue40780] str.format() handles trailing zeros inconsistently in “general” format

2020-05-26 Thread David Chambers

New submission from David Chambers :

According to 
https://docs.python.org/3/library/string.html#format-specification-mini-language,
 “insignificant trailing zeros are removed from the significand” when 'g' is 
specified. I encountered a situation in which a trailing zero is not removed:

$ python3
Python 3.7.7 (default, Mar 10 2020, 15:43:03)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> '{0:.3g}'.format(1504)
'1.5e+03'
>>> '{0:.3g}'.format(1505)
'1.50e+03'
>>> '{0:.3g}'.format(1506)
'1.51e+03'

Is this behaviour intentional? If so, why is the trailing zero in 1.50 
considered significant for 1505 but insignificant for 1504?

--
messages: 369983
nosy: davidchambers
priority: normal
severity: normal
status: open
title: str.format() handles trailing zeros inconsistently in “general” format
type: behavior

___
Python tracker 

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



[issue40779] incorrect end column for single argument generator function call AST

2020-05-26 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue40778] Updating Py_REFCNT and Py_SIZE to use _PyObject_CAST_CONS

2020-05-26 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue40779] incorrect end column for single argument generator function call AST

2020-05-26 Thread Tomasz Pytel


New submission from Tomasz Pytel :

When calling a function with a single argument which is an unparenthesized 
generator expression the end column for the AST node is incorrect, it is one 
greater than the start of the function call parentheses where I assume it 
should be one past the closing parentheses.

This call:

func(i for i in range(3))

Generates the following node for the generator expression (line:col_offset -> 
end_line:end_col_offset):

<_ast.GeneratorExp object at 0x7f3ba61f78c0> .. 1:4 -> 1:5

--
components: Interpreter Core
messages: 369982
nosy: Tomasz Pytel
priority: normal
severity: normal
status: open
title: incorrect end column for single argument generator function call AST
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



[issue38580] select()'s documentation claims only sequences are accepted, but it allows all iterables

2020-05-26 Thread Jakub Stasiak


Jakub Stasiak  added the comment:

Cheers for backporting this, Tal, you beat me to it!

--

___
Python tracker 

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



[issue38580] select()'s documentation claims only sequences are accepted, but it allows all iterables

2020-05-26 Thread miss-islington


miss-islington  added the comment:


New changeset 500cd89ecce97750a1af32d4097d9945b7296bac by Miss Islington (bot) 
in branch '3.9':
bpo-38580: Document that select() accepts iterables, not just sequences 
(GH-16832)
https://github.com/python/cpython/commit/500cd89ecce97750a1af32d4097d9945b7296bac


--

___
Python tracker 

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



[issue39321] AMD64 FreeBSD Non-Debug 3.x: out of swap space (test process killed by signal 9)

2020-05-26 Thread STINNER Victor


STINNER Victor  added the comment:

Oh. I'm not sure that it works as expected :-(

AMD64 FreeBSD Non-Debug 3.x build 804, Finished 18 minutes ago:

https://buildbot.python.org/all/#/builders/214/builds/804
0:33:28 load avg: 4.64 [329/425/1] test_code_module passed -- running: 
test_multiprocessing_forkserver (2 min 13 sec)
*** Signal 9

--

___
Python tracker 

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



[issue38580] select()'s documentation claims only sequences are accepted, but it allows all iterables

2020-05-26 Thread Tal Einat


Tal Einat  added the comment:


New changeset 3f215f35bdb9d666f5a692fc60f800da1bb1e4a9 by Tal Einat in branch 
'3.7':
[3.7] bpo-38580: Document that select() accepts iterables, not just sequences 
(GH-16832)
https://github.com/python/cpython/commit/3f215f35bdb9d666f5a692fc60f800da1bb1e4a9


--

___
Python tracker 

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



[issue38580] select()'s documentation claims only sequences are accepted, but it allows all iterables

2020-05-26 Thread Tal Einat


Tal Einat  added the comment:


New changeset e3e800f3d28881cc9de38cd9bcbcf8fbdea238a6 by Tal Einat in branch 
'3.8':
[3.8] bpo-38580: Document that select() accepts iterables, not just sequences 
(GH-16832)
https://github.com/python/cpython/commit/e3e800f3d28881cc9de38cd9bcbcf8fbdea238a6


--

___
Python tracker 

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



  1   2   >