[issue45476] [C API] Disallow using PyFloat_AS_DOUBLE() as l-value

2021-11-14 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

Marc-Andre:
> Inlining is something that is completely under the control of the
used compilers. Compilers are free to not inline function marked for
inlining [...]

I checked the following C snippet on gcc.godbolt.org using GCC 4.1.2 and Clang 
3.0.0 with /-O0/-O1/-Os, and both compilers inline a function marked 
as static inline:

static inline int foo(int a)
{
return a * 2;
}

int bar(int a)
{
return foo(a) < 0;
}

So even with -O0, GCC from 2007 and Clang from 2011 perform inlining. Though, 
old versions of CLang leave a dangling original copy of foo for some reason. I 
hope a linker removes it later.

As for other compilers, I believe that if somebody specifies -O0, that person 
has a sound reason to do so (like per-line debugging, building precise flame 
graphs, or other specific scenario where execution performance does not 
matter), so inlining interferes here anyway.

--
nosy: +arhadthedev

___
Python tracker 

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



[issue45512] [sqlite3] simplify "isolation level"

2021-11-14 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset b567b9d74bd9e476a3027335873bb0508d6e450f by Erlend Egeberg 
Aasland in branch 'main':
bpo-45512: Simplify isolation_level handling in `sqlite3` (GH-29053)
https://github.com/python/cpython/commit/b567b9d74bd9e476a3027335873bb0508d6e450f


--

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-11-14 Thread Stefan Pochmann


Stefan Pochmann  added the comment:

Turns out for n=100_000, k=50_000, about 87% of my factors are 1, so they don't 
even need to be turned into Python ints for multiplication, improving the 
multiplication part to 3.05 ms. And a C++ version to produce the factors took 
0.85 ms. Updated estimation:

1510.4 ms  math.comb(n, k)
 460.8 ms  factorial(n) // (factorial(k) * factorial(n-k))
   3.9 ms  *estimation* for mycomb if written in C

--

___
Python tracker 

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



[issue45806] Cannot Recover From StackOverflow in 3.9 Tests

2021-11-14 Thread David Bolen


Change by David Bolen :


--
nosy: +db3l

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-11-14 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Since this isn't quite related to the original issue, I opened bpo-45806 to 
discuss.

--

___
Python tracker 

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



[issue45806] Cannot Recover From StackOverflow in 3.9 Tests

2021-11-14 Thread Dennis Sweeney


New submission from Dennis Sweeney :

In bpo-30570, David Bolen noticed that "py -3.9 -m test test_pickle" 
consistently crashes on Windows (even though other methods of running that test 
do not crash, and the test succeeds when failed tests are retried).

Curiously, it seems that adding using support.infinite_recursion *introduced* 
the crash rather than preventing it.

I'm guessing this would have been fixed by GH-24501, but that fix was rolled 
back in GH-25179 for the sake of 3.9 ABI compatibility.

As of now, 3.9's pycore_ceval.c reads:

static inline int _Py_RecursionLimitLowerWaterMark(int limit) {
if (limit > 200) {
return (limit - 50);
}
else {
return (3 * (limit >> 2));
}
}

But support.infinite_recursion(max_depth=75) has a default 75, leaving a 
"low-water-mark" of 54, which the recursion apparently never recovers back to 
in the right way.


A couple of solutions could fix this:

(1) Remove the usage of support.infinite_recursion at the 
test.pickletester.AbstractPickleTests.test_bad_getattr call site.

(2) Use a different value max_depth. On my machine at least, it seems 75 was a 
"perfect storm" to cause this issue. Using infinite_recursion(60) or 61 or ... 
or 74 or 76 or 77 or 78 all pass, but infinite_recursion(75) in particular 
fails.

(3) Use fewer calls after the overflow by inlining something like assertRaises:

 with support.infinite_recursion():
-self.assertRaises(RuntimeError, self.dumps, x, proto)
+try:
+self.dumps(x, proto)
+except RuntimeError:
+pass
+else:
+self.fail("RuntimeError not raised")

(5) Re-visit an ABI-compliant version of GH-24501, such as GH-25160



The output I keep getting without any changes:

> py -3.9 -m test test_pickle -v
...
test_attribute_name_interning (test.test_pickle.CPicklerTests) ... ok
test_bad_getattr (test.test_pickle.CPicklerTests) ... Fatal Python error: 
_Py_CheckRecursiveCall: Cannot recover from stack overflow.Python runtime 
state: initialized

Current thread 0x28b0 (most recent call first):
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\pickletester.py", line 
3300 in __getattr__
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\pickletester.py", line 
3300 in __getattr__
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\pickletester.py", line 
3300 in __getattr__
  ...
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\pickletester.py", line 
3300 in __getattr__
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\pickletester.py", line 
3300 in __getattr__
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\pickletester.py", line 
3300 in __getattr__
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\copyreg.py", line 74 in 
_reduce_ex
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\test_pickle.py", line 
65 in dumps
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\case.py", line 201 
in handle
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\case.py", line 739 
in assertRaises
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\pickletester.py", line 
2381 in test_bad_getattr
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\test\support\__init__.py", 
line 1770 in wrapper
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\case.py", line 550 
in _callTestMethod
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\case.py", line 592 
in run
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\case.py", line 651 
in __call__
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\suite.py", line 
122 in run
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\suite.py", line 84 
in __call__
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\suite.py", line 
122 in run
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\suite.py", line 84 
in __call__
  File "C:\Users\sween\Source\Repos\cpython2\39\lib\unittest\suite.py", line 
122 in run

--
components: Tests
messages: 406339
nosy: Dennis Sweeney, Mark.Shannon, lukasz.langa
priority: normal
severity: normal
status: open
title: Cannot Recover From StackOverflow in 3.9 Tests
type: crash
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



[issue37295] Possible optimizations for math.comb()

2021-11-14 Thread Stefan Pochmann


Stefan Pochmann  added the comment:

And for Raymond's case 4), about running very long and not responding to 
SIGINT, with n=1_000_000 and k=500_000:

150.91 seconds  math.comb(n, k)
 39.11 seconds  factorial(n) // (factorial(k) * factorial(n-k))
  0.40 seconds  mycomb(n, k)
  0.14 seconds  *estimation* for mycomb if written in C

And for n=10_000_000 and k=5_000_000:

   ~4 hours*estimation* for math.comb(n, k)
   ~1 hour *estimation* for factorials solution
  8.3 seconds  mycomb(n, k)
  4.5 seconds  *estimation* for mycomb if written in C

--

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-11-14 Thread Stefan Pochmann


Stefan Pochmann  added the comment:

I wrote a Python solution ("mycomb") that computes comb(100_000, 50_000) 
faster, maybe of interest:

1510.4 ms  math.comb(n, k)
 460.8 ms  factorial(n) // (factorial(k) * factorial(n-k))
  27.5 ms  mycomb(n, k)
   6.7 ms  *estimation* for mycomb if written in C

The idea:

13 * 12 * 11 * 10 * 9 * 8
comb(13, 6)  =  -  =  13 * 1 * 11 * 1 * 3 * 4
  1 * 2 * 3 * 4 * 5 * 6

It lists the numerator factors, then divides the denominator factors out of 
them (using primes), then just multiplies.

Preparing the factors for the final multiplication took most of the time, about 
23.1 ms. That part only needs numbers <= n, so it could be done with C ints and 
be much faster. If it's ten times faster, then mycomb in C would take 23.1/10 + 
(27.5-23.1) = 6.71 ms.

See the comb_with_primes.py file.

--
nosy: +Stefan Pochmann
Added file: https://bugs.python.org/file50439/comb_with_primes.py

___
Python tracker 

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



[issue15500] Python should support exporting thread names to the OS

2021-11-14 Thread Eryk Sun


Eryk Sun  added the comment:

Zackery, here's an initial draft implementation for Windows 10+ that's based on 
the interface you created in PR 14578. It calls WinAPI SetThreadDescription(), 
which sets the thread's name directly in the kernel thread object (i.e. 
ETHREAD.ThreadName). This function was added to the API in Windows 10 version 
1607 (10.0.14393), so Windows 8.1 systems and older Windows 10 systems aren't 
supported. I'd rather not implement the exception-based approach for older 
Windows systems. It doesn't really name the thread and only works when a 
debugger is attached to the process.

This initial draft blindly assumes that the filesystem encoding is UTF-8. 
That's been the case in Windows since Python 3.6, unless configured to use the 
legacy ANSI encoding, e.g. by setting PYTHONLEGACYWINDOWSFSENCODING. 
PyThread_set_thread_name() could be changed to use CP_ACP instead of CP_UTF8 
when legacy mode is enabled.

I set the truncation limit to 64 characters. It could be lowered to 15 to match 
what you implemented for POSIX, but I think that's too short. The limit could 
also effectively be removed by truncating to the system limit of 32766 
characters. That would be simpler since the code wouldn't have to worry about 
surrogate pairs.

Python/thread_nt.h:

typedef HRESULT (WINAPI *PF_SET_THREAD_DESCRIPTION)(HANDLE, PCWSTR);
static PF_SET_THREAD_DESCRIPTION pSetThreadDescription = NULL;

static void
PyThread__init_thread(void)
{
// Initialize pSetThreadDescription.
// Minimum supported Windows version: 10.0.14393 (1607)
int i = 0;
LPCWSTR module_names[2] = {
L"api-ms-win-core-processthreads-l1-1-3", // i.e. kernel32
L"kernelbase",
};
// Most "ms-win-core" API sets (except for COM/WinRT) are implemented
// by modules that are always loaded, including ntdll, kernelbase, and
// kernel32, so it's safe to use GetModuleHandleW().
do {
pSetThreadDescription = (PF_SET_THREAD_DESCRIPTION)GetProcAddress(
GetModuleHandleW(module_names[i]), "SetThreadDescription");
} while (pSetThreadDescription == NULL &&
 ++i < Py_ARRAY_LENGTH(module_names));
}

int
PyThread_set_thread_name(const char *name)
{
HRESULT hr = 0;
wchar_t *wname = NULL;

if (!initialized) {
PyThread_init_thread();
}
if (name == NULL || *name == '\0') {
hr = E_INVALIDARG;
goto exit;
}
if (pSetThreadDescription == NULL) {
hr = E_NOTIMPL;
goto exit;
}

// cch includes the terminating null character.
int cch = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0);
if (cch > 0) {
wname = PyMem_RawMalloc(cch * sizeof(wchar_t));
if (wname == NULL) {
hr = E_OUTOFMEMORY;
goto exit;
}
cch = MultiByteToWideChar(CP_UTF8, 0, name, -1, wname, cch);
}
if (cch == 0) {
hr = HRESULT_FROM_WIN32(GetLastError());
goto exit;
}

// Truncate the name to 64 characters, accounting for surrogate pairs.
// The OS limit is 32766 wide characters, but long names aren't of
// practical use.
int i = 0;
for (int len = 0; i < (cch - 1) && len < 64; i++, len++) {
if (i < (cch - 2) && IS_SURROGATE_PAIR(wname[i], wname[i + 1])) {
i++; // Skip the trailing surrogate.
}
}
wname[i] = L'\0';

hr = pSetThreadDescription(GetCurrentThread(), wname);

exit:
if (wname != NULL) {
PyMem_RawFree(wname);
}
if (FAILED(hr)) {
return (int)hr;
}
return 0;
}


Modules/_threadmodule.c:

static PyObject *
_thread__set_thread_name_impl(PyObject *module, PyObject *name)
{
int error = PyThread_set_thread_name(PyBytes_AS_STRING(name));
#ifdef MS_WINDOWS
// For Python code, ignore a not-implemented error, which means
// it's a Windows 8.1 system or older Windows 10 system.
if (error == (int)E_NOTIMPL) {
error = 0;
}
#endif
if (error) {
Py_DECREF(name);
PyErr_SetString(ThreadError, "setting the thread name failed");
return NULL;
}
Py_DECREF(name);
Py_RETURN_NONE;
}

--
nosy: +eryksun
versions: +Python 3.11

___
Python tracker 

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



[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2021-11-14 Thread Carey


Change by Carey :


--
nosy: +pR0Ps
nosy_count: 6.0 -> 7.0
pull_requests: +27808
pull_request: https://github.com/python/cpython/pull/29560

___
Python tracker 

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



[issue25625] "chdir" Contex manager for pathlib

2021-11-14 Thread Cameron Simpson


Cameron Simpson  added the comment:

On 15Nov2021 01:04, Python Bug Reports  wrote:
>Can you share the link? I haven't seen anything recent. Is it under 
>other thread?

It's in the discuss-ideas part of discuss.python.org during a 
discussions about a possible new context manager to atomically prepare a 
filename. Latest comment:

https://discuss.python.org/t/adding-atomicwrite-in-stdlib/11899/15

and I'm with Inada-san here: I think shutil is a better fit for both the 
chdir context manager and the thing under discussion. They're both "high 
level shell-like things" to my mind.

--

___
Python tracker 

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



[issue25625] "chdir" Contex manager for pathlib

2021-11-14 Thread Filipe Laíns

Filipe Laíns  added the comment:

Can you share the link? I haven't seen anything recent. Is it under other 
thread?

--

___
Python tracker 

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



[issue25625] "chdir" Contex manager for pathlib

2021-11-14 Thread Éric Araujo

Éric Araujo  added the comment:

There is renewed discussion on python-dev about placing this in contextlib.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue45650] cgitb does not emit CGI headers when format='text'

2021-11-14 Thread Eric V. Smith


Change by Eric V. Smith :


--
status: open -> pending

___
Python tracker 

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



[issue44743] asyncio DatagramProtocol stops calling callbacks after OSError

2021-11-14 Thread Szymon


Szymon  added the comment:

I'm experiencing the same exact issue. The bug manifests with all combinations: 
SelectorEventLoop and ProactorEventLoop, python 3.9 and 3.10, on Windows 10. 
Python 3.8 on Linux seems to not be affected. Can we get a fix or at least an 
update?

--
nosy: +sim1234

___
Python tracker 

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



[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-11-14 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset c3997865f24d9491318b401ae8e46d27332aca25 by Christian Heimes in 
branch 'main':
bpo-45573: Use Makefile's dependencies in setup.py (GH-29559)
https://github.com/python/cpython/commit/c3997865f24d9491318b401ae8e46d27332aca25


--

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-11-14 Thread David Bolen


David Bolen  added the comment:

So I'm guessing something is just borderline under 3.9 on Windows.

In some manual testing with a standalone build of 3.9 so far for me:
  -m test.test_pickle always succeeds (executed directly)
  -m test test_pickle always fails (executed via test module)
  -m test -w -j1 test_pickle  fails, but succeeds on retry

The failures seem to always occur in CPicklerTests.test_bad_getattr.  I'm not 
sure how to run that single test via the test module, but limiting to all 
CPicklerTests tests or all test_bad_getattr tests succeeds even through the 
test module.

The last scenario above (successful retry) has to use -j or else no retry (-w) 
takes place.  That's the path the buildbots are following.

--

___
Python tracker 

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



[issue45573] Use pkg-config autoconf macros to detect flags for Modules/Setup

2021-11-14 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27807
pull_request: https://github.com/python/cpython/pull/29559

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-14 Thread Matthias Bussonnier


Matthias Bussonnier  added the comment:

Works for me as well. Thanks.

--

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-11-14 Thread David Bolen


David Bolen  added the comment:

I don't know if this is a buildbot, test or 3.9-specific issue but this commit 
appears to have introduced a permanent initial failure (but success on retry) 
in test_pickle on both Windows 10 3.9 builders.  First failure for my builder 
at https://buildbot.python.org/all/#/builders/425/builds/450

Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
0:14:47 load avg: 4.57 Re-running failed tests in verbose mode
0:14:47 load avg: 4.57 Re-running test_pickle in verbose mode

The 3.x and 3.10 builders seem fine, and the second try on 3.9 always seems to 
succeed (perhaps because it's just a single test running at that point), so 
this is only being reported as a buildbot warning.

--
nosy: +db3l

___
Python tracker 

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



[issue45804] IDLE - faster shell writing

2021-11-14 Thread Roger Serwy


Roger Serwy  added the comment:

All good questions, Terry! I do have a git clone of the cpython repo, but I 
haven't worked through the new commit/patch process since Mercurial. I'm a bit 
rusty.

The buffering provided is for calls to `write`. It does not do any line 
buffering. Calls to `isatty` will behave the same. The negative side effect is 
that the subprocess will proceed as if writes have been committed to the 
PyShell window, so any pending transfers can be lost if the subprocess 
terminates unexpectedly.

I used a separate OS thread to handle the transfer of the writes rather than 
using the Tcl/Tk event loop. The Tcl/Tk loop runs on the main thread, so any 
long-running processes will prevent a `.after` callback function from being 
called.

The base class was not changed. I haven't followed all the changes to the 
stream class (and its implications) since 3.5, so the code subclasses the newer 
`StdOutputFile` class to minimize disruption.

--

___
Python tracker 

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



[issue45742] python -h can't find -R option

2021-11-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

If you two agree on an exact wording, I can make the PR and backport.

--

___
Python tracker 

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



[issue44532] multi subinterpreters use _PyStructSequence_InitType failed.

2021-11-14 Thread Hai Shi


Hai Shi  added the comment:

OK,thanks. If it's just only interal calling, I don't think throwing a 
exception would break anything. As your pasted code shows, the modules have 
judeged the tp_name is inited or not.

--

___
Python tracker 

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



[issue45650] cgitb does not emit CGI headers when format='text'

2021-11-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

I would think the use case for 'text' is to not print the output to a web page, 
so you wouldn't want the headers. The documentation says that cgitb was 
generalized to not only produce output for web pages. The 'text' format 
provides this generalization.

Changing to an enhancement request for 3.11. We can't change the 'text' format 
because it would break existing code. so this is really an enhancement request 
for a new format. But I don't see what the use case would be, so I don't think 
it would be accepted.

What's the case where you need this functionality? How is the 'html' format 
unacceptable?

--
nosy: +eric.smith
type: behavior -> enhancement
versions:  -Python 3.10, 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



[issue45796] Using tab to cycle through tkinter widgets breaks foreground styling

2021-11-14 Thread E. Paine


E. Paine  added the comment:

I believe this is just because the `selectbackground` is only shown when the 
widget has focus. Try, for example, only selecting part of the text and then 
tabbing off. Therefore, I think this is not a bug. The only thing which makes 
me slightly doubt myself is that this behaviour is platform-specific, and not 
reproducible on Linux, but this could just be down to Windows design guidelines.

IMO, this issue should be closed as "not a bug". If you think this is an issue 
that should be taken further, please raise it with the Tk team: 
https://core.tcl-lang.org/tk/reportlist

--
nosy: +epaine, serhiy.storchaka

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-14 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue45738] 3.11 exec raises SystemError instead of SyntaxError on char after line continuation

2021-11-14 Thread PEW's Corner


PEW's Corner  added the comment:

Seems to work. Thanks!

--

___
Python tracker 

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



[issue21644] Optimize bytearray(int) constructor to use calloc()

2021-11-14 Thread Bruce Merry


Bruce Merry  added the comment:

> I abandonned the issue because I didn't have time to work on it. If you want, 
> you can open a new issue for that.

If I make a pull request and run some microbenchmarks, will you (or some other 
core dev) have time to review it? I've had a bad experience before with a PR 
that I'm still unable to get reviewed after several years, so I'd like to get 
at least a tentative agreement before I invest time in it.

--

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington


miss-islington  added the comment:


New changeset 9f9a3028e3bb923e726789ab3ea5ce298b596bc6 by Miss Islington (bot) 
in branch '3.9':
bpo-45752: Remove "array" from list of things that cannot be copied in `copy` 
module docstring (GH-29555)
https://github.com/python/cpython/commit/9f9a3028e3bb923e726789ab3ea5ce298b596bc6


--

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington


miss-islington  added the comment:


New changeset 55d24edaadba4ee90f464d88b44075649788f128 by Miss Islington (bot) 
in branch '3.10':
bpo-45752: Remove "array" from list of things that cannot be copied in `copy` 
module docstring (GH-29555)
https://github.com/python/cpython/commit/55d24edaadba4ee90f464d88b44075649788f128


--

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27806
pull_request: https://github.com/python/cpython/pull/29558

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27805
pull_request: https://github.com/python/cpython/pull/29557

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington


miss-islington  added the comment:


New changeset c2c4fdf5ea6e9cba4ef469d08a52abb9cfa756a5 by Alex Waygood in 
branch 'main':
bpo-45752: Remove "array" from list of things that cannot be copied in `copy` 
module docstring (GH-29555)
https://github.com/python/cpython/commit/c2c4fdf5ea6e9cba4ef469d08a52abb9cfa756a5


--

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington


miss-islington  added the comment:


New changeset 2081f9fe75a3a990394fbccd0c1c91c229c6289e by M. Mostafa Farzan in 
branch '3.10':
[3.10] bpo-45752: Fix no-support examples in 'copy' docs (GH-29548) (GH-29556)
https://github.com/python/cpython/commit/2081f9fe75a3a990394fbccd0c1c91c229c6289e


--

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Mohammad Mostafa Farzan


Change by Mohammad Mostafa Farzan :


--
pull_requests: +27804
pull_request: https://github.com/python/cpython/pull/29556

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood
nosy_count: 7.0 -> 8.0
pull_requests: +27803
pull_request: https://github.com/python/cpython/pull/29555

___
Python tracker 

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



[issue45742] python -h can't find -R option

2021-11-14 Thread Eryk Sun


Eryk Sun  added the comment:

How about this?

Enable hash randomization. This option overrides PYTHONHASHSEED
to use the default behavior.

--

___
Python tracker 

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



[issue45742] python -h can't find -R option

2021-11-14 Thread STINNER Victor


STINNER Victor  added the comment:

If I understand correctly

https://docs.python.org/3.10/using/cmdline.html#cmdoption-R

"This option only has an effect if the PYTHONHASHSEED environment variable is 
set to 0"

should be replaced with:

"This option only has an effect if the PYTHONHASHSEED environment variable is 
set"

Is that correct?

Does someone want to write a PR for that?

--

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington


miss-islington  added the comment:


New changeset 6073920fcdb5a36d20a6a7c6ee204f74f00e1cb4 by Miss Islington (bot) 
in branch '3.9':
bpo-45752: Fix no-support examples in 'copy' docs (GH-29548)
https://github.com/python/cpython/commit/6073920fcdb5a36d20a6a7c6ee204f74f00e1cb4


--

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +27802
pull_request: https://github.com/python/cpython/pull/29554

___
Python tracker 

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



[issue45752] copy module doc wrongly says it doesn't copy arrays

2021-11-14 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset b7360ae395e9e633d384d16064c5dc04a9841e19 by M. Mostafa Farzan in 
branch 'main':
bpo-45752: Fix no-support examples in 'copy' docs (GH-29548)
https://github.com/python/cpython/commit/b7360ae395e9e633d384d16064c5dc04a9841e19


--
nosy: +asvetlov

___
Python tracker 

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



[issue45800] Move expat handling into configure and Makefile

2021-11-14 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 464e6616be86129e33af6d9e43540c260d6804d5 by Christian Heimes in 
branch 'main':
bpo-45800: Move pyexpat build setup into configure (GH-29547)
https://github.com/python/cpython/commit/464e6616be86129e33af6d9e43540c260d6804d5


--

___
Python tracker 

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



[issue45800] Move expat handling into configure and Makefile

2021-11-14 Thread Christian Heimes


Change by Christian Heimes :


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



[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook


Saul Shanabrook  added the comment:

Actually, keeping this open. 

I am still unclear if this is expected behavior or not, but I do notice that 
the dis module is unable to read the flag when the annotations future is 
imported.

For example `dis.pretty_flags(compile("from __future__ import annotations", "", 
"exec").co_flags)` return `'NOFREE, 0x100'`. 

Sorry for the repeated messages.

--
status: closed -> open

___
Python tracker 

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



[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook


Saul Shanabrook  added the comment:

I am closing this because, I realized I was unclear on whether the future flags 
end up as code flags. I thought we were just missing this one, but then 
realized that none of the other future flags are documented either.

I had found a flag that was not recognized, 0x100, and for some reason 
thought it was related to the future annotations import.

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



[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook


New submission from Saul Shanabrook :

The CO_FUTURE_ANNOTATIONS code flag was added in Python 3.7 I believe in this 
PR https://github.com/python/cpython/pull/4390.

However, it does not appear in dis's COMPILER_FLAG_NAMES map and so is not 
documented in inspect or pretty printed.

I believe the fix would be to add it to the dict in dis as well as document it 
in inspect.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 406309
nosy: docs@python, saulshanabrook
priority: normal
severity: normal
status: open
title: CO_FUTURE_ANNOTATIONS flag is not documented or in inspect
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