[issue44308] Raw Strings lack parody

2021-06-03 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Remember that backslash escapes are only a Python syntactic feature. If you 
read data from a file, or from the input() builtin, that contains a backslash, 
it remains a backslash:

>>> s = input()
a\b
>>> print(len(s), s == r'a\b')
3 True

Backslashes are only special in two cases: as source code, and when displaying 
a string (or bytes) using `repr`.

So if you get a regex from the user, say by reading it from a file, or from 
stdin, or from a text field in a GUI, etc. and that regex contains a backslash, 
your string will contain a backslash and you don't need anything special.

Does this solve your problem?

--

___
Python tracker 

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



[issue44308] Raw Strings lack parody

2021-06-03 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I think you have missed something important here:

>>> data = b'foo\bar'
>>> len(data)
6
>>> print(data)
b'foo\x08ar'


If you want bytes including a backslash followed by a b, you need to use raw 
bytes rb'foo\bar' or escape the backslash.

Also Python 3.8 is in feature-freeze so the earliest this new feature could be 
added to the language is now 3.11.

--
nosy: +steven.daprano
type: behavior -> enhancement
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue13299] namedtuple row factory for sqlite3

2021-06-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

FWIW, namedtuple speed improved considerably since these posts were made.  When 
I last checked, their lookup speed was about the same as a dict lookup.  

See: https://docs.python.org/3/whatsnew/3.9.html#optimizations

--

___
Python tracker 

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



[issue44308] Raw Strings lack parody

2021-06-03 Thread Nicholas Willhite


New submission from Nicholas Willhite :

I'm really sure this isn't filed correctly. I'm a total noob to this process, 
so feel free to redirect me. :) 

Bytes can be defined as a function, or a prefixed series. You can prefix a 
series with "b" and get the expected data type. You can also use the builtin 
functions "bytes" to get the same structure:

  bytes('foo\bar', 'utf-8') == b'foo\bar'
  True

But there's no builtin function for r'foo\bar' that gives you 'foo\\bar'.

This would be really handy for applications that accept a regular expression. 
If that regex was part of the source code, I'd just r'foo\bar' to get the 
expected string. Being able to accept something like bytes and do:

  data = b'foo\bar'
  raw_string(data)
  'foo\\bar'

would be really useful for applications that accept a regex as input. 

Is there an obvious way to do this that I'm not seeing? Has my google-foo 
failed me? Feels like a function that should exist in the stdlib.

Again, really sure I'm not "doing this correctly." So please direct me! :) 

Appreciative,
-Nick Willhite

--
components: Unicode
messages: 395064
nosy: Nicholas Willhite, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: Raw Strings lack parody
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue44307] date.today() is 2x slower than datetime.now().date()

2021-06-03 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44307] date.today() is 2x slower than datetime.now().date()

2021-06-03 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue43654] IDLE: Fix tab completion after settings and some keys

2021-06-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> The unknown is whether anyone has changed these
> pseudoevent bindings and if so, how much do we care?  

I don't think we care.  Getting tab completion sorted out is the priority.

--
nosy: +rhettinger

___
Python tracker 

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



[issue44300] using Linked list vs dynamic array for LifoQueue class

2021-06-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Lists appends and pops are already amortized O(1) operations.  As they grow, 
they over-allocate by 12.5%.  When shrinking they reclaim memory when the size 
falls in half.  Together, these two strategies make lists efficient as a LIFO 
stack.

A straight linked list has worse performance across the board.  There would be 
an allocation on every append and deallocation on every pop.  Links tend to be 
scattered across memory causing cache locality to lost.  Also, links have more 
space overhead than the individual pointers used by a list.

If any change were to be made, it would likely be to use deque() instead of a 
list.  The timings in Tools/scripts/var_access_benchmark.py show that deques 
are slightly better than what we have now.  However, small deques take more 
space than small lists.  Also, deques are vastly outperformed by lists when 
running PyPy.  So we should stick with the very close second runner up.

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

___
Python tracker 

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



[issue44307] date.today() is 2x slower than datetime.now().date()

2021-06-03 Thread Anthony Sottile


New submission from Anthony Sottile :

```console
$ python3.10 -m timeit -s 'from datetime import datetime' 
'datetime.now().date()'
50 loops, best of 5: 708 nsec per loop
$ python3.10 -m timeit -s 'from datetime import date' 'date.today()'
20 loops, best of 5: 1.4 usec per loop
```

this surprised me so I dug into it -- it appears a fast path can be added to 
`date.today()` to make it faster than `datetime.date.now()` -- though I'm 
rather unfamiliar with the functions involved here

here is my ~sloppy patch attempting to add a fast path, I would need some 
guidance to improve it and get it accepted:

```diff
$ git diff -w
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 8ef2dad37a..7eaa5d1740 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -2875,6 +2875,17 @@ date_fromtimestamp(PyObject *cls, PyObject *obj)
 static PyObject *
 date_today(PyObject *cls, PyObject *dummy)
 {
+/* fast path, don't call fromtimestamp */
+if ((PyTypeObject *)cls == _DateType) {
+struct tm tm;
+time_t t;
+time();
+localtime_r(, );
+return new_date_ex(tm.tm_year + 1900,
+   tm.tm_mon + 1,
+   tm.tm_mday,
+   (PyTypeObject*)cls);
+} else {
 PyObject *time;
 PyObject *result;
 _Py_IDENTIFIER(fromtimestamp);
@@ -2893,6 +2904,7 @@ date_today(PyObject *cls, PyObject *dummy)
 Py_DECREF(time);
 return result;
 }
+}
 
 /*[clinic input]
 @classmethod
```

after this, `date.today()` is faster!

```console
$ ./python -m timeit -s 'from datetime import datetime' 'datetime.now().date()'
50 loops, best of 5: 764 nsec per loop
$ ./python -m timeit -s 'from datetime import date' 'date.today()'
50 loops, best of 5: 407 nsec per loop
```

\o/

--
components: Extension Modules
messages: 395061
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: date.today() is 2x slower than datetime.now().date()
type: performance
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



[issue31552] IDLE: Convert browswers to use ttk.Treeview

2021-06-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Concrete reason 3. Treewidget does not work on high-res monitors.  The #37041 
quick Treeview test worked for Andre Roberge

--
nosy: +aroberge
versions: +Python 3.11 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-03 Thread Eric Snow


Eric Snow  added the comment:


New changeset b2bf2bc1ece673d387341e06c8d3c2bc6e259747 by Mark Shannon in 
branch 'main':
bpo-43693: Compute deref offsets in compiler (gh-25152)
https://github.com/python/cpython/commit/b2bf2bc1ece673d387341e06c8d3c2bc6e259747


--

___
Python tracker 

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



[issue32280] Expose `_PyRuntime` through a section name

2021-06-03 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 35002aa8f62dda1f79035e9904abdf476683e9be by Max Bélanger in 
branch 'main':
bpo-32280: Store _PyRuntime in a named section (GH-4802)
https://github.com/python/cpython/commit/35002aa8f62dda1f79035e9904abdf476683e9be


--
nosy: +pablogsal

___
Python tracker 

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



[issue32280] Expose `_PyRuntime` through a section name

2021-06-03 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



[issue44305] Improve syntax error for try block without finally or except block

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e53f72a1b42e17a331ed14bec674b1ee01d0720c by Pablo Galindo in 
branch '3.10':
[3.10] bpo-44305: Improve syntax error for try blocks without except or finally 
(GH-26523) (GH-26524)
https://github.com/python/cpython/commit/e53f72a1b42e17a331ed14bec674b1ee01d0720c


--

___
Python tracker 

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



[issue44305] Improve syntax error for try block without finally or except block

2021-06-03 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



[issue44305] Improve syntax error for try block without finally or except block

2021-06-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25118
pull_request: https://github.com/python/cpython/pull/26524

___
Python tracker 

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



[issue44305] Improve syntax error for try block without finally or except block

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset b250f89bb7e05e72a4641d44b988866b919575db by Pablo Galindo in 
branch 'main':
bpo-44305: Improve syntax error for try blocks without except or finally 
(GH-26523)
https://github.com/python/cpython/commit/b250f89bb7e05e72a4641d44b988866b919575db


--

___
Python tracker 

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



[issue44306] asyncio.from_thread

2021-06-03 Thread Thomas Grainger


Thomas Grainger  added the comment:

"""High-level support for working with threads in asyncio"""

import functools
import contextvars

from . import events
from . import tasks


__all__ = "to_thread", "from_thread"


class _Local(threading.local):
loop = None


_local = _Local()


def _with_loop(loop, func, /, *args, **kwargs):
_loop.loop = loop
try:
return func(*args, **kwargs)
finally:
_loop.loop = None


async def to_thread(func, /, *args, **kwargs):
"""Asynchronously run function *func* in a separate thread.

Any *args and **kwargs supplied for this function are directly passed
to *func*. Also, the current :class:`contextvars.Context` is propogated,
allowing context variables from the main thread to be accessed in the
separate thread.

Return a coroutine that can be awaited to get the eventual result of *func*.
"""
loop = events.get_running_loop()
ctx = contextvars.copy_context()
func_call = functools.partial(_with_loop, loop, ctx.run, func, *args, 
**kwargs)
return await loop.run_in_executor(None, func_call)


def _create_task(async_func, /, *args, **kwargs):
return events.create_task(async_func(*args, **kwargs))


async def _with_context(ctx, async_func, /, *args, **kwargs):
return await ctx.run(_create_task, async_func, *args, **kwargs)


def from_thread(async_func, /, *args, **kwargs):
"""Synchronously run function *async_func* in the event loop thread.

Any *args and **kwargs supplied for this function are directly passed
to *func*. Also, the current :class:`contextvars.Context` is propogated,
allowing context variables from the main thread to be accessed in the
separate thread.

Return a concurrent.futures.Future to wait for the result from the event
loop thread.
"""
loop = _loop.loop
if loop is None:
raise RuntimeError(
"asyncio.from_thread can only be run in a thread started by "
"asyncio.to_thread"
)

ctx = contextvars.copy_context()
return tasks.run_coroutine_threadsafe(loop, _with_context(ctx, async_func, 
*args, **kwargs))

--

___
Python tracker 

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



[issue44306] asyncio.from_thread

2021-06-03 Thread Thomas Grainger


New submission from Thomas Grainger :

create a asyncio.from_thread shortcut to run async functions from a thread 
started with asyncio.to_thread


```
def from_thread(async_func, /, *args, **kwargs):
"""Synchronously run function *async_func* in the event loop thread.

Any *args and **kwargs supplied for this function are directly passed
to *func*. Also, the current :class:`contextvars.Context` is propogated,
allowing context variables from the main thread to be accessed in the
separate thread.

Return a concurrent.futures.Future to wait for the result from the event
loop thread.
```

--
components: asyncio
messages: 395054
nosy: asvetlov, graingert, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.from_thread

___
Python tracker 

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



[issue44305] Improve syntax error for try block without finally or except block

2021-06-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44305] Improve syntax error for try block without finally or except block

2021-06-03 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Given this script:
try:
x = 34

a = 1

instead of printing:
  File "/home/pablogsal/github/python/master/lel.py", line 4
a = 1
^
SyntaxError: invalid syntax

we should print:

  File "/home/pablogsal/github/python/master/lel.py", line 4
a = 1
^
SyntaxError: expected 'except' or 'finally' block

--
messages: 395053
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Improve syntax error for try block without finally or except block

___
Python tracker 

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



[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Ned Batchelder


Ned Batchelder  added the comment:

Thanks for the quick turnaround, this works!

--

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-03 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



[issue44042] [sqlite3] _pysqlite_connection_begin() optimisations

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3446516ffa92c98519146253153484291947b273 by Erlend Egeberg 
Aasland in branch 'main':
bpo-44042: Optimize sqlite3 begin transaction (GH-25908)
https://github.com/python/cpython/commit/3446516ffa92c98519146253153484291947b273


--
nosy: +pablogsal

___
Python tracker 

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



[issue44042] [sqlite3] _pysqlite_connection_begin() optimisations

2021-06-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy:  -pablogsal
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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset de58b319af3a72440a74e807cf8a1194ed0c6d8c by Batuhan Taskaya in 
branch '3.9':
[3.9] bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) 
(GH-26522)
https://github.com/python/cpython/commit/de58b319af3a72440a74e807cf8a1194ed0c6d8c


--

___
Python tracker 

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



[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3283bf4519139cf62ba04a76930f84ca1e7da910 by Pablo Galindo in 
branch '3.10':
[3.10] bpo-44273: Improve syntax error message for assigning to "..." 
(GH-26477) (GH-26478)
https://github.com/python/cpython/commit/3283bf4519139cf62ba04a76930f84ca1e7da910


--

___
Python tracker 

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



[issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> And I've identified the issue is in test_close_kill_running. The patch for 
> resolving the crash in bpo-38323 can be the cause of the newly introduced hang

Also, how did you reached this conclusion?

--

___
Python tracker 

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



[issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows

2021-06-03 Thread STINNER Victor


Change by STINNER Victor :


--
priority: deferred blocker -> 

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-03 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +25116
pull_request: https://github.com/python/cpython/pull/26522

___
Python tracker 

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



[issue11105] Compiling recursive Python ASTs crash the interpreter

2021-06-03 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
components: +Interpreter Core -None
priority: low -> normal
title: Compiling evil ast crashes interpreter -> Compiling recursive Python 
ASTs crash the interpreter
versions: +Python 3.11, Python 3.9

___
Python tracker 

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



[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-06-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Global module state has been established by 
f461a7fc3f8740b9e79e8874175115a3474e5930 (bpo-42862, GH-24203). We can safely 
migrate static variables into that struct as a next step.

--

___
Python tracker 

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



[issue11105] Compiling evil ast crashes interpreter

2021-06-03 Thread miss-islington


miss-islington  added the comment:


New changeset 976598d36bd180024c5f0edf1f7ec0f0b436380f by Miss Islington (bot) 
in branch '3.10':
bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)
https://github.com/python/cpython/commit/976598d36bd180024c5f0edf1f7ec0f0b436380f


--

___
Python tracker 

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



[issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, test_wrong_cert_tls13() and test_pha_required_nocert() of test_ssl should 
now be more reliable on Windows. I consider that the initial issue is now fixed 
and I close the issue.

--
components: +SSL, Tests
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d2ab15f5376aa06ed120164f1b84bb40adbdd068 by Miss Islington (bot) 
in branch '3.10':
bpo-43921: Fix test_ssl.test_wrong_cert_tls13() on Windows (GH-26502) (GH-26518)
https://github.com/python/cpython/commit/d2ab15f5376aa06ed120164f1b84bb40adbdd068


--

___
Python tracker 

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



[issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5c2191df9a21a3b3d49dd0711b8d2b92591ce82b by Victor Stinner in 
branch 'main':
bpo-43921: Cleanup test_ssl.test_wrong_cert_tls13() (GH-26520)
https://github.com/python/cpython/commit/5c2191df9a21a3b3d49dd0711b8d2b92591ce82b


--

___
Python tracker 

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



[issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots

2021-06-03 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I've also been trying to debug it for the whole day. Not sure what's causing 
this. (Why does all error occur in Fedora buildbots? If I remember correctly, 
another test also failed there.")

--

___
Python tracker 

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



[issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots

2021-06-03 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

> How did you managed? I ran test_asyncio for almost 5 hours with -R in my 
> linux machine and could not reproduce?

Now it's not again not reproducing. Maybe I used some wrong flag. But I'll try 
to debug this issue.

--

___
Python tracker 

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



[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-06-03 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



[issue11105] Compiling evil ast crashes interpreter

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset f3491242e41933aa9529add7102edb68b80a25e9 by Batuhan Taskaya in 
branch 'main':
bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)
https://github.com/python/cpython/commit/f3491242e41933aa9529add7102edb68b80a25e9


--
nosy: +pablogsal

___
Python tracker 

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



[issue11105] Compiling evil ast crashes interpreter

2021-06-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +25115
pull_request: https://github.com/python/cpython/pull/26521

___
Python tracker 

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



[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset f461a7fc3f8740b9e79e8874175115a3474e5930 by Erlend Egeberg 
Aasland in branch 'main':
bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module 
(GH-24203)
https://github.com/python/cpython/commit/f461a7fc3f8740b9e79e8874175115a3474e5930


--
nosy: +pablogsal

___
Python tracker 

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



[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Ned, can you confirm that this works for you? I am closing the issue, but if 
something is missing, please, reopen it and we will look into it :)

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



[issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>  And extending the buildbot timer may not help since it seems it's running 
> infinitely

Extending the bot time was done so we can use faulthandler to identify the 
test, because buildbot was cancelling the whole build before that :)

--

___
Python tracker 

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



[issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Victor, this issue is reproducible on Linux. I reproduced it on my WSL.

How did you managed? I ran test_asyncio for almost 5 hours with -R in my linux 
machine and could not reproduce?

--

___
Python tracker 

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



[issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots

2021-06-03 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Victor, this issue is reproducible on Linux. I reproduced it on my WSL. And 
I've identified the issue is in test_close_kill_running. The patch for 
resolving the crash in bpo-38323 can be the cause of the newly introduced hang. 
test_close_kill_running is running and passing and again it is running all over 
again infinitely. And extending the buildbot timer may not help since it seems 
it's running infinitely. Even if we look at the buildbot log there is no sign 
of crash but suddenly buildbot says "timeout!".

--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue44301] Is there a way to provide destructor for module written using C API?

2021-06-03 Thread Azat Ibrakov


Azat Ibrakov  added the comment:

With this setup
https://gist.github.com/lycantropos/f9243dc98e104a13ddd991316e93d31a
I get prompt about module being initialized but that's it: it never gets 
deleted and reference count for `Rational` keeps increasing. What am I missing?

--

___
Python tracker 

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



[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset cea0585b7939b487d7089f9d473f495264e8a491 by Mark Shannon in 
branch '3.10':
[3.10] bpo-44298: Backport #26513 to 3.10 (#26516)
https://github.com/python/cpython/commit/cea0585b7939b487d7089f9d473f495264e8a491


--

___
Python tracker 

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



[issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path

2021-06-03 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

There is a report about this change might have caused behaviour change  for '.' 
in sys.path between 3.10.0a7 and 3.10.0b1

https://mail.python.org/archives/list/python-...@python.org/thread/DE3MDGB2JGOJ3X4NWEGJS26BK6PJUPKW/

--
nosy: +orsenthil

___
Python tracker 

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



[issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window.

2021-06-03 Thread Zachary Ware


Zachary Ware  added the comment:

I don't see anything that looks odd from your screenshots, so I'll go ahead and 
close it.  Steve can leave a note here if there was actually something going 
weird on the server that he fixed.

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default

2021-06-03 Thread James Gerity


James Gerity  added the comment:

The cause of DeprecationWarning sometimes [1] not being issued is I believe 
because in string_parser.c [2] the module is explicitly set to NULL and the 
filename will be '' or '' or somesuch, which eventually that 
ends up being normalized to something that isn't '__main__'. 

Not sure if this is stating the obvious and I don't see any general solution 
short of adding a filter for the special filenames, but I caught wind of this 
in #python on Libera, got curious, and thought I'd share what I learned here. 
I've also attached a gdb session showing how changing the filename affects this 
behavior.

Reproducing this in debug/dev contexts is definitely fraught, since the warning 
behavior is different.

[1] The given compile() sample, at the REPL, when using -c, or when piping 
input via stdin are the ones I know about
[2] 
https://github.com/python/cpython/blob/f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970/Parser/string_parser.c#L19-L20

--
nosy: +SnoopJeDi2
Added file: https://bugs.python.org/file50091/gdb_deprecationwarning_session.txt

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-03 Thread mike bayer


mike bayer  added the comment:

if the issue is in greenlet this can be bounced back to 
https://github.com/python-greenlet/greenlet/issues/242

--

___
Python tracker 

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



[issue44304] segmentation fault appeared in python 3.10.0b2

2021-06-03 Thread mike bayer


New submission from mike bayer :

segmentation fault related to object deallocation and traceback objects, is 
extremely difficult to reproduce and definitely appeared as of 3.10.0b2, does 
not occur in 3.10.0b1.   linux and osx platforms are affected.

The issue requires "greenlet==1.1.0" to be installed, as well as that for me to 
reproduce it I have to use sqlite3 with some special APIs also, so while this 
issue might be in greenlet, or sqlite3, I have a feeling these are all factors 
that are combining together in a very random way to reveal something that's 
actually happening in the interpreter, but in any case would be great if core 
devs can see why it happens.  The below script has been tested on various linux 
platforms, and the overall bug was revealed by an interaction in the SQLAlchemy 
test suite that's occurring in many places including OSX, linux.   As noted, a 
whole bunch of very random things are needed for me to reproduce it.


import greenlet
import sqlite3


class _ErrorContainer(object):
error = None


def _expect_raises_fn(fn):
ec = _ErrorContainer()
try:
fn()
except Exception as err:
assert str(err) == "this is a test"

# assign the exception context outside of the except
# is necessary
ec.error = err

# don't del the exception context is necessary
#del ec


def greenlet_spawn(fn, *args, **kwargs):

# spawning a greenlet is necessary
context = greenlet.greenlet(fn, greenlet.getcurrent())

# assignment to "result" is necessary
result = context.switch(*args, **kwargs)

# raising exception is necessary
raise Exception("this is a test")


class OuterConnectionWrapper:
def __init__(self, connection):
self.connection = connection

def go(self, stmt):
sqlite_connection = self.connection
cursor = sqlite_connection.cursor()
cursor.execute("select 1")
return cursor

def execute(self, stmt):
return greenlet_spawn(self.go, stmt)

def _do_close(self):
self.connection.close()
self.connection = None

def close(self):
self._do_close()


class InnerConnectionWrapper:
def __init__(self, connection):
self.connection = connection

def create_function(self, *arg, **kw):
self.connection.create_function(*arg, **kw)

def cursor(self):
return self.connection.cursor()

def close(self):
self.connection = None


class ConnectionPool:
def __init__(self):
self.conn = sqlite3.connect(":memory:")

def regexp(a, b):
return None

self.conn.create_function("regexp", 2, regexp)

def connect(self):
return InnerConnectionWrapper(self.conn)


def do_test():
pool = ConnectionPool()

def go():
c1 = pool.connect()
conn = OuterConnectionWrapper(c1)
try:
conn.execute("test")
finally:
conn.close()

_expect_raises_fn(go)


do_test()

--
components: Interpreter Core
messages: 395028
nosy: zzzeek
priority: normal
severity: normal
status: open
title: segmentation fault appeared in python 3.10.0b2
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



[issue27153] Default value shown by argparse.ArgumentDefaultsHelpFormatter is backwards for action='store_false'

2021-06-03 Thread wim glenn


Change by wim glenn :


--
nosy: +wim.glenn

___
Python tracker 

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



[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2021-06-03 Thread wim glenn


Change by wim glenn :


--
nosy: +wim.glenn

___
Python tracker 

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



[issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window.

2021-06-03 Thread Sunny Jamshedji


Sunny Jamshedji  added the comment:

Screenshot 4

Yes, I would agree, since it stopped happening on the 3rd and 4th try like 
someone noticed something on the server end; maybe a little guy running around 
inside the server, IDK?!

I'd close this myself, but it was certainly quite bizarre.

--
Added file: https://bugs.python.org/file50090/4. Python 3.8.10 Installer.png

___
Python tracker 

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



[issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window.

2021-06-03 Thread Sunny Jamshedji


Sunny Jamshedji  added the comment:

Screenshot 3

--
Added file: https://bugs.python.org/file50089/3. Use Show in Folder Opens 
Downloads.png

___
Python tracker 

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



[issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window.

2021-06-03 Thread Sunny Jamshedji


Sunny Jamshedji  added the comment:

Screenshot 2.

--
Added file: https://bugs.python.org/file50088/2. Used Save Link As.png

___
Python tracker 

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



[issue29249] Pathlib glob ** bug

2021-06-03 Thread wim glenn


Change by wim glenn :


--
nosy: +wim.glenn

___
Python tracker 

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



[issue44303] Buildbot website failing with 503

2021-06-03 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


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

___
Python tracker 

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



[issue44303] Buildbot website failing with 503

2021-06-03 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Ok. Now it's back up again. Was a glitch perhaps.

--

___
Python tracker 

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



[issue44303] Buildbot website failing with 503

2021-06-03 Thread Shreyan Avigyan


New submission from Shreyan Avigyan :

I was trying to debug a issue (the test_asyncio random failing problem) when 
suddenly Buildbot is showing up with "503 Service Unavailable
No server is available to handle this request.". It's constantly failing with 
the request. I'm not sure if it's only for me though.

--
components: Demos and Tools
messages: 395023
nosy: shreyanavigyan
priority: normal
severity: normal
status: open
title: Buildbot website failing with 503

___
Python tracker 

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



[issue44238] Unable to install Python 3.9.5 - Windows Server

2021-06-03 Thread Steve Dower


Steve Dower  added the comment:

I see this line in your log:

Rejecting product '{6504EEE5-2172-4D34-A76D-0372356396B4}': Non-assigned apps 
are disabled for non-admin users.

I'm not entirely sure what it means, or how you managed to install it under 
this apparent restriction, but it looks like the issue.

I'll have to take some time to research it, but someone else may figure it out 
first, so wanted to post this much.

--

___
Python tracker 

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



[issue37224] [subinterpreters] test__xxsubinterpreters fails randomly

2021-06-03 Thread hai shi


hai shi  added the comment:

OK, I try to take a look after Kyle leaves temporarily. But I haven't replicate 
this issue in my vm in recent days :(

--
nosy: +shihai1991
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2021-06-03 Thread Steve Dower


Steve Dower  added the comment:

You shouldn't need to install the redistributable, but if you can't, then you 
have an issue that is not limited to CPython and it's not something we can fix.

It sounds like you didn't try disabling any virus scanners. That may still 
help. If not, I don't know, sorry.

--

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-03 Thread Brandt Bucher


Brandt Bucher  added the comment:

I'm hoping we can get something close that for free by just waiting... the 
faster-cpython folks are working on a tagged-pointer implementation of integers 
as we speak.

I've been looking for a new project, so I'd love to help work on this issue (if 
you're open to it). The pattern compiler is a bit of a beast, and I like to 
think I have a better than-average-understanding of it. ;)

--

___
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

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 by Victor Stinner in 
branch 'main':
bpo-39573: Py_TYPE becomes a static inline function (GH-26493)
https://github.com/python/cpython/commit/f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970


--

___
Python tracker 

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



[issue44302] compile fail when make install run pip install as sudo

2021-06-03 Thread Battant


New submission from Battant :

Hello,
5.4.0-73-generic
Here is my configuration
ubuntu 20.04
linux kernel 5.4.0-73-generic

step to reproduce

clone cpytjpm 3.11 repository

https://github.com/python/cpython

compile with this tcl
./configure -with-tcltk-includes=/usr/include/ 
--with-tcltk-libs=/usr/local/lib/libtcl.so --enable-optimizations

make
sudo make install

Actual result :

compil fail because pip is run as sudo to install python

rm -f /usr/local/bin/idle3
(cd /usr/local/bin; ln -s idle3.11 idle3)
rm -f /usr/local/bin/pydoc3
(cd /usr/local/bin; ln -s pydoc3.11 pydoc3)
rm -f /usr/local/bin/2to3
(cd /usr/local/bin; ln -s 2to3-3.11 2to3)
if test "x" != "x" ; then \
rm -f /usr/local/bin/python3-32; \
(cd /usr/local/bin; ln -s python3.11-32 python3-32) \
fi
if test "x" != "x" ; then \
rm -f /usr/local/bin/python3-intel64; \
(cd /usr/local/bin; ln -s python3.11-intel64 python3-intel64) \
fi
rm -f /usr/local/share/man/man1/python3.1
(cd /usr/local/share/man/man1; ln -s python3.11.1 python3.1)
if test "xupgrade" != "xno"  ; then \
case upgrade in \
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \
 ./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmpr3j5u6l0
Requirement already satisfied: setuptools in 
/usr/local/lib/python3.11/site-packages (56.0.0)
Requirement already satisfied: pip in /usr/local/lib/python3.11/site-packages 
(21.1.1)
WARNING: Running pip as root will break packages and permissions. You should 
install packages reliably by using venv: https://pip.pypa.io/warnings/venv

See attachement log detais

Could you help me please to fix this issus

Best regards

Battant

--
components: Build
files: output.log
messages: 395017
nosy: Battant
priority: normal
severity: normal
status: open
title: compile fail when make install run pip install as sudo
versions: Python 3.11
Added file: https://bugs.python.org/file50087/output.log

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 84d80f5f30b1f545083c70a7d4e1e79ab75f9fa6 by Erlend Egeberg 
Aasland in branch '3.10':
[3.10] bpo-42972: Track sqlite3 statement objects (GH-26475) (GH-26515)
https://github.com/python/cpython/commit/84d80f5f30b1f545083c70a7d4e1e79ab75f9fa6


--

___
Python tracker 

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



[issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache

2021-06-03 Thread miss-islington


miss-islington  added the comment:


New changeset d88b47b5a396aa8d66f9a0e6b13a0825d59d0eff by Erlend Egeberg 
Aasland in branch 'main':
bpo-42213: Remove redundant cyclic GC hack in sqlite3 (GH-26517)
https://github.com/python/cpython/commit/d88b47b5a396aa8d66f9a0e6b13a0825d59d0eff


--
nosy: +miss-islington

___
Python tracker 

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



[issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows

2021-06-03 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +25114
pull_request: https://github.com/python/cpython/pull/26520

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-06-03 Thread Eric Snow


Eric Snow  added the comment:


New changeset 2c1e2583fdc4db6b43d163239ea42b0e8394171f by Eric Snow in branch 
'main':
bpo-43693: Add new internal code objects fields: co_fastlocalnames and 
co_fastlocalkinds. (gh-26388)
https://github.com/python/cpython/commit/2c1e2583fdc4db6b43d163239ea42b0e8394171f


--

___
Python tracker 

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



[issue37041] IDLE: path browser unusable on some displays

2021-06-03 Thread Andre Roberge


Change by Andre Roberge :


--
status: open -> closed

___
Python tracker 

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



[issue44301] Is there a way to provide destructor for module written using C API?

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:

Hi, you should use the multiphase initialization API which has clear and free 
functions.
https://www.python.org/dev/peps/pep-0489/#the-proposal

See for example the source code of the Modules/_abc.c extension.

--
nosy: +vstinner

___
Python tracker 

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



[issue44301] Is there a way to provide destructor for module written using C API?

2021-06-03 Thread Azat Ibrakov


New submission from Azat Ibrakov :

I'm reimplementing `fractions.Fraction` class using C API 
(https://github.com/lycantropos/cfractions).

And the problem is that I want to use `numbers.Rational` interface in my type 
checks to add support for user-defined rational numbers.

I see how it's done for `decimal.Decimal` class:
https://github.com/python/cpython/blob/142e5c5445c019542246d93fe2f9e195d3131686/Modules/_decimal/_decimal.c#L2916
but the problem is: I don't see when/where we call `Py_DECREF(Rational)`, so it 
looks like this class will not be "freed" until the  end of the program.

So my question is: is there any way to define some function which will be 
called once module is not used?

--
components: C API
messages: 395012
nosy: lycantropos
priority: normal
severity: normal
status: open
title: Is there a way to provide destructor for module written using C API?
versions: 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



[issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows

2021-06-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25113
pull_request: https://github.com/python/cpython/pull/26518

___
Python tracker 

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



[issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache

2021-06-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +25112
pull_request: https://github.com/python/cpython/pull/26517

___
Python tracker 

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



[issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ea0210fa8ccca769896847f25fc6fadfe9a717bc by Victor Stinner in 
branch 'main':
bpo-43921: Fix test_ssl.test_wrong_cert_tls13() on Windows (GH-26502)
https://github.com/python/cpython/commit/ea0210fa8ccca769896847f25fc6fadfe9a717bc


--

___
Python tracker 

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



[issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h'

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:

Well, as soon as the buildbot worker is green, it works for me :-D

--

___
Python tracker 

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



[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +25111
pull_request: https://github.com/python/cpython/pull/26516

___
Python tracker 

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



[issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache

2021-06-03 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 82ad22a97d4b5d7134424f12bd6a61167db7f4f8 by Erlend Egeberg 
Aasland in branch 'main':
bpo-42213: Check connection in sqlite3.Connection.__enter__ (GH-26512)
https://github.com/python/cpython/commit/82ad22a97d4b5d7134424f12bd6a61167db7f4f8


--
nosy: +vstinner

___
Python tracker 

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



[issue44293] PEP 585 breaks inspect.isclass

2021-06-03 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Btw this reminds me I should make a PyPI release of typing_inspect (last 
release was May 2020), hopefully will make a release on this weekend.

--

___
Python tracker 

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



[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 937cebc93b4922583218e0cbf0a9a14705a595b2 by Mark Shannon in 
branch 'main':
bpo-44298: Fix line numbers for early exits in with statements. (GH-26513)
https://github.com/python/cpython/commit/937cebc93b4922583218e0cbf0a9a14705a595b2


--

___
Python tracker 

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



[issue44293] PEP 585 breaks inspect.isclass

2021-06-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

Instead of introspecting types, use this library:
https://github.com/ilevkivskyi/typing_inspect

--

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-06-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +25110
pull_request: https://github.com/python/cpython/pull/26515

___
Python tracker 

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



[issue21363] io.TextIOWrapper always closes wrapped files

2021-06-03 Thread Marten H. van Kerkwijk


Marten H. van Kerkwijk  added the comment:

In astropy we are now working around the auto-closing of the underlying stream 
in TextIOWrapper by subclassing and overriding `__del__` to detach [1]. It 
would seem more elegant if `TestIOWrapper` (and really, `BufferedReader`) could 
gain an `closefd` argument, just like `open` has, which is `True` by default.

p.s. Do let me know if it is better to open a new issue.

[1] https://github.com/astropy/astropy/pull/11809

--
nosy: +mhvk
type:  -> enhancement

___
Python tracker 

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



[issue44300] using Linked list vs dynamic array for LifoQueue class

2021-06-03 Thread Mihai Ion


New submission from Mihai Ion :

Switching to Linked list data structure for improving performance append() and 
pop() run time complexity when eliminating dynamic array resizing

--
components: Library (Lib)
files: main.py
messages: 395004
nosy: euromike21
priority: normal
severity: normal
status: open
title: using Linked list vs dynamic array for LifoQueue class
type: performance
versions: Python 3.11
Added file: https://bugs.python.org/file50086/main.py

___
Python tracker 

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



[issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window.

2021-06-03 Thread Zachary Ware


Zachary Ware  added the comment:

I suspect one or more of your screenshots did not make it through submission 
(you can only attach one at a time), but are you quite certain you got things 
straight here?  This is the first report we've had of this, and I'm quite sure 
there would have been a flood of others if this were the case :)

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue44286] venv activate script would be good to show failure.

2021-06-03 Thread john kim


john kim  added the comment:

Thank you for your explanation of venv.

I understand that venv is not portable. 

But I was confused because the venv was written on the left side of the 
terminal line and it looked like it was working.

Therefore, if venv does not work, such as if __venv_dir__ is invalid path, i 
thought any warning message or exception handling was necessary. Or (venv) 
doesn't show up.

--

___
Python tracker 

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



[issue39560] PyUnicode_FromKindAndData kind transformation is not documented

2021-06-03 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue44293] PEP 585 breaks inspect.isclass

2021-06-03 Thread Ken Jin


Ken Jin  added the comment:

@Jelle thanks for nosy-ing me too and the thorough investigation.

@Joseph

Thanks for taking the time to raise this inconvenience on the bug tracker.

> By the way, Python typing is so much unstable (every version breaks the 
> previous one), it's very complicated to write code that support multiple 
> versions, so whatever the typing internal implementation, we must adapt.

Compared to some of the more mature modules in Python, I have to agree that 
typing.py is mildly unstable. However, you're not supposed to be 
using/importing from the internal constructs - those have no guarantee of 
stability. If you feel some common use cases aren't met by the current 
introspection helpers, please please please create a new issue for that and 
we'll consider it. How we use typing may differ from how you use it and so 
there's a lot we don't see. User bug reports and feedback have helped to 
surface such issues and improved typing for everyone :). 

> I have chosen `list[int]` as an example of `types.GenericAlias` introduced by 
> PEP 585 (i could have chosen `set[int]` or 
> `collections.abc.Collection[int]`). But other generic aliases, e.g. 
> `typing.List[int]` or `MyClass[int]` (where `MyClass` inherits `Generic[T]`), 
> are not instances of `type`.

This is an implementation detail. Most typing PEPs don't usually specify the 
runtime behavior in detail because most of them focus on static analysis. The 
implementation is usually up to the contributor's judgement. FWIW, to 
accommodate the new 3.9 GenericAlias, typing.py just added additional checks 
for `isinstance(tp, types.GenericAlias)` instead of checking only for 
`isinstance(tp, type)` and friends.

--

___
Python tracker 

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



[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue39560] PyUnicode_FromKindAndData kind transformation is not documented

2021-06-03 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:


New changeset 4eed2821d40373345ed133b2b8d912fef59acab7 by Zackery Spytz in 
branch 'main':
bpo-39560: Document PyUnicode_FromKindAndData() kind transformation (GH-23848)
https://github.com/python/cpython/commit/4eed2821d40373345ed133b2b8d912fef59acab7


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers

2021-06-03 Thread Kirill Pinchuk


Kirill Pinchuk  added the comment:

Oh, sorry bad wording.

The current implementation has reconnection logic only for UNIX sockets
The patch adds reconnection logic for UDP/TCP sockets as well.


I've done it with minimal changes to the existing code to accomplish that. And 
probably it can be merged.

But in general, it looks like we can refactor SysLogHandler to inherit from 
SocketHandler. Not sure if it should be done in this PR or better to create 
separate?

--

___
Python tracker 

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



[issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers

2021-06-03 Thread Vinay Sajip


Vinay Sajip  added the comment:

> right now it has reconnection logic for unixsocket but not for tcp/udp

Should it not have UDP/TCP supported as well as domain sockets, before being 
reviewed?

--
nosy: +vinay.sajip

___
Python tracker 

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



[issue44286] venv activate script would be good to show failure.

2021-06-03 Thread Vinay Sajip


Vinay Sajip  added the comment:

venvs aren't meant to be portable (i.e. renaming the directory or moving to a 
new location). Scripts installed into a venv have absolute paths pointing to 
the location when the venv was created.

venvs should be treated as throwaway resources that can be readily recreated - 
so if you need a venv in a new location, just create it there and install the 
desired packages again.

--

___
Python tracker 

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



[issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h'

2021-06-03 Thread Matt Billenstein

Matt Billenstein  added the comment:

I have been stopping it since the initial problem - there’s something wonky 
with using the system python on  macos afaict...

M

--
Matt Billenstein
m...@vazor.com

> On Jun 3, 2021, at 4:39 AM, STINNER Victor  wrote:
> 
> 
> STINNER Victor  added the comment:
> 
> "So, I'd been trying various things before the master restart (...) I'll let 
> this bake, seems pretty strange changing the interpreter running the
> buildbot would matter - everything else should be the same however."
> 
> If you can, try to stop your buildbot client when you upgrade your system. 
> System upgrades always caused hiccups on buildbots, it's ok. It's just 
> suprising when I got an error and don't know that the system was upgraded.
> 
> I close again the issue ;-)
> 
> --
> resolution:  -> fixed
> stage:  -> resolved
> status: open -> closed
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon


Mark Shannon  added the comment:

Why this occurs:

with cm: 
A
break

translates to something like:

ex = cm.__exit__; cm.__enter__()  # with cm
A
ex(...)
goto loop_end   # break

So, the break is traced after the exit call.

However, this doesn't seem consistent with try-finally statements which trace 
any break/continue/return before the finally block.

--
keywords: +3.10regression
nosy: +pablogsal
priority: normal -> release blocker
stage:  -> needs patch

___
Python tracker 

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



[issue44298] 3.10.0b2 traces with-exit before the break that caused the exit

2021-06-03 Thread Mark Shannon


Mark Shannon  added the comment:

For context, this behavior was introduced in https://bugs.python.org/issue43933

--

___
Python tracker 

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



[issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache

2021-06-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +25108
pull_request: https://github.com/python/cpython/pull/26512

___
Python tracker 

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



  1   2   >