[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2021-04-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sure. Thanks for reminder.

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



[issue43829] MappingProxyType cannot hash a hashable underlying mapping

2021-04-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Perhaps MappingProxyType is unhashable by accident. It implements __eq__, and 
it makes it unhashable by default. And nobody made request for this feature 
before. I think that implementing __hash__ would not make anything wrong.

--

___
Python tracker 

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



[issue43838] There is a way to access an underlying mapping in MappingProxyType

2021-04-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The purpose of MappingProxyType is to provide a read-only proxy for mapping. It 
should not expose the underlying mapping because it would invalidate the 
purpose of read-only proxy. But there is a way to do this using comparison 
operator:

from types import MappingProxyType

orig = {1: 2}
proxy = MappingProxyType(orig)

class X:
def __eq__(self, other):
other[1] = 3

assert proxy[1] == 2
proxy == X()
assert proxy[1] == 3
assert orig[1] == 3

In particularly it allows to modify __dict__ of builtin types.

--
components: Interpreter Core
messages: 391039
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: There is a way to access an underlying mapping in MappingProxyType
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Paul Pinterits


Paul Pinterits  added the comment:

No, I'm saying Bar should initialize the 'bar' attribute, and then call 
Foo.__init__ to let it initialize the 'foo' attribute.

--

___
Python tracker 

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



[issue43829] MappingProxyType cannot hash a hashable underlying mapping

2021-04-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

But there is an issue with comparison implementation in MappingProxyType (see 
issue43838). Resolving that issue can affect the decision about hashability.

There should be always true the following predicate: if x == y then hash(x) == 
hash(y).

--

___
Python tracker 

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



[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-04-14 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Hi. I just want to know why is and, or operators behaving like this. The 
behavior is described in https://bugs.python.org/issue43833#msg390996. Moreover 
I researched a little more and found out even if __and__, __or__ methods are 
defined the and, or operators doesn't seem to work. As Serhiy described in 
https://bugs.python.org/issue43833#msg390998 the parser reads [0x1for x in 
(1,2)] as [0x1f or x in (1,2)] which is the parser's fault but why is the or 
operator behaving like that?

--

___
Python tracker 

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



[issue43733] PEP 597: netrc uses locale encoding.

2021-04-14 Thread Inada Naoki


Inada Naoki  added the comment:

I googled "netrc UnicodeDecodeError". It is very rare, but I found two cases.

* 
https://stackoverflow.com/questions/54748450/macos-python-3-netrc-operations-end-up-with-unicodedecodeerror
  This user uses macOS and Python tried UTF-8. But .netrc was not UTF-8.

* https://qiita.com/yuji38kwmt/items/5472c98cb800ccaab093
  This user uses Windows. They write .netrc with UTF-8, but Python used cp932.

---

There are several options:

* Use UTF-8. If user encountered UnicodeDecodeError, user need to change the 
.netrc encoding.
* Use UTF-8 with "surrogateescape" or "replace" error handler. non-UTF-8 in 
comments are ignored.
* Use latin-1. non-ASCII characters in comments are ignored.

--

___
Python tracker 

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



[issue43837] Operator precedence documentation could be more clear

2021-04-14 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> There isn't any mention of variables. While not operators, probably worth 
> mentioning that they (effectively?) have higher precedence than any of the 
> operators.

I'm sorry, I don't understand what that means.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2021-04-14 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Raymond:
> 1) move the expensive get_functools_state_by_type() inside the code block 
> that creates new links, so that it won't affect a full cache.

This should be as easy as adding a _functools_state pointer to struct 
lru_cache_object, init that pointer in lru_cache_new(), and then fetch it from 
self in infinite_lru_cache_wrapper() and bounded_lru_cache_wrapper(), no? Diff 
attached.

--
nosy: +erlendaasland
Added file: https://bugs.python.org/file49958/patch.diff

___
Python tracker 

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



[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Paul Pinterits


Paul Pinterits  added the comment:

Admittedly, with the way dataclasses accept their __init__ arguments, figuring 
out which arguments to consume and which to pass on isn't a trivial task.

If a dataclass Bar inherits from a dataclass Foo, then Bar.__init__ is (for all 
intents and purposes) defined as

def __init__(self, foo, bar):

Because the arguments for the parents *precede* the arguments for Bar, it's not 
easy to create an equivalent __init__ without knowing anything about the base 
class(es)'s constructor arguments. But that doesn't mean it's impossible:

```
class Foo:
foo: int

def __init__(self):
self.foo = 5

class Bar(Foo):
bar: int

def __init__(self, *args, **kwargs):
if 'bar' in kwargs:
self.bar = kwargs.pop('bar')
else:
*args, self.bar = args

super().__init__(*args, **kwargs)

print([Bar(1), Bar(bar=1)])
```

Essentially, Bar.__init__ looks for a keyword argument named 'bar', and if that 
doesn't exist, it uses the last positional argument as the value for 'bar'.

This is backwards compatible with "normal" dataclasses, and improves support 
for dataclasses with custom __init__s.

--

___
Python tracker 

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



[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

But Bar(1, 2), Bar(1, foo=2), Bar(bar=1, foo=2) all give errors. These are all 
valid if both Foo and Bar are decorated with @dataclass.

Calling base class __init__() functions is an incompatible change, and I don't 
think we'll make any change to do so.

--

___
Python tracker 

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



[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Paul Pinterits


Paul Pinterits  added the comment:

You're telling me that some people out there rely on their custom __init__ 
*not* being called? O.o

--

___
Python tracker 

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



[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

Yes, I'm sure it happens.

from dataclasses import dataclass

@dataclass
class Foo:
foo: int

def __init__(self, a, b, c):
self.foo = a * b * c

@dataclass
class Bar(Foo):
bar: int


print(Bar(1, 2))
print(Foo(1, 2, 3))

--

___
Python tracker 

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



[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-04-14 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

@shreyanavigyan This is a bit off-topic, but it's called "short-circuiting", 
described here: 
https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not
(or/and aren't really "operators", like +/- etc, they cannot be overridden, 
they evaluate their components lazily and are therefore almost control flow)

--

___
Python tracker 

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



[issue43831] sqlite: convert_timestamp raises ValueError for empty columns

2021-04-14 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-04-14 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

@Carl.Friedrich.Bolz Thanks a lot for clarifying. For a second, I thought it 
was maybe a bug.

--

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

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



[issue43804] Add more info about building C/C++ Extensions on Windows using MSVC

2021-04-14 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Kindly have a review of my PR.

--

___
Python tracker 

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



[issue43839] [easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u

2021-04-14 Thread STINNER Victor


New submission from STINNER Victor :

Does someone want to propose a fix for the following warning?

$ ./python -m test test_cmd_line
0:00:00 load avg: 6.45 Run tests sequentially
0:00:00 load avg: 6.45 [1/1] test_cmd_line
/home/vstinner/python/master/Lib/test/test_cmd_line.py:865: DeprecationWarning: 
invalid escape sequence \u
  self.check_string(b"'\u1f'")

== Tests result: SUCCESS ==

1 test OK.

Total duration: 15.9 sec
Tests result: SUCCESS

--
components: Tests
keywords: easy, newcomer friendly
messages: 391053
nosy: vstinner
priority: normal
severity: normal
status: open
title: [easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u
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



[issue43839] [easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u

2021-04-14 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings

2021-04-14 Thread STINNER Victor


New submission from STINNER Victor :

test_distutils logs 3 DeprecationWarning warnings. They are emitted on purpose 
and related to PEP 632.

Does someone want to propose a fix for that?

"with self.assertWarns(DeprecationWarning):" or 
warnings_helper.check_warnings() of test.support.warnings_helper can be used.


$ ./python -m test -v test_distutils 
(...)
0:00:00 load avg: 5.49 [1/1] test_distutils
/home/vstinner/python/master/Lib/test/test_distutils.py:8: DeprecationWarning: 
The distutils package is deprecated and slated for removal in Python 3.12. Use 
setuptools or check PEP 632 for potential alternatives
  import distutils.tests

(...)

test_byte_compile_optimized (distutils.tests.test_build_py.BuildPyTestCase) ... 
/tmp/tmpptdx9r50.py:1: DeprecationWarning: The distutils package is deprecated 
and slated for removal in Python 3.12. Use setuptools or check PEP 632 for 
potential alternatives
  from distutils.util import byte_compile
ok

(...)

test_byte_compile (distutils.tests.test_install_lib.InstallLibTestCase) ... 
/tmp/tmpk_cfc09q.py:1: DeprecationWarning: The distutils package is deprecated 
and slated for removal in Python 3.12. Use setuptools or check PEP 632 for 
potential alternatives
  from distutils.util import byte_compile
ok

(...)

Tests result: SUCCESS

--

By the way, it would be nice to ignore the DeprecationWarning in setup.py as 
well for now:

$ make
(...)
/home/vstinner/python/master/./setup.py:33: DeprecationWarning: The distutils 
package is deprecated and slated for removal in Python 3.12. Use setuptools or 
check PEP 632 for potential alternatives
  from distutils import log
(...)

This warning is annoying.

--
components: Tests
keywords: easy, newcomer friendly
messages: 391054
nosy: vstinner
priority: normal
severity: normal
status: open
title: [easy] test_distutils logs 3 DeprecationWarning warnings

___
Python tracker 

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



[issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

Another warning:

$ ./python -m test -v test_check_c_globals
(...)
DeprecationWarning: The distutils package is deprecated and slated for removal 
in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.ccompiler
(...)
Tests result: SUCCESS

--

___
Python tracker 

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



[issue43841] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread STINNER Victor


New submission from STINNER Victor :

Does someone want to propose a fix?

$ ./python -m test -v test_collections 
(...)
test_issue_4920 (test.test_collections.TestCollectionABCs) ... 
/home/vstinner/python/master/Lib/test/test_collections.py:1518: 
DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(len(s), len(items) - 1)
ok
(...)
Tests result: SUCCESS


Warning introduced by PR 25209:

commit 453074c8daf996b1815a0cd2218f0dbf1801056c
Author: Stepan Sindelar 
Date:   Thu Apr 8 01:31:55 2021 +0200

Fix broken test for MutableSet.pop() (GH-25209)

Changes the test to not assert concrete result of pop, but just that it
was an item from the set, and that the set shrunk by one.

--
components: Tests
keywords: easy, newcomer friendly
messages: 391056
nosy: vstinner
priority: normal
severity: normal
status: open
title: [easy] test_collections: DeprecationWarning: Please use assertEqual 
instead
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



[issue43842] test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD

2021-04-14 Thread STINNER Victor


New submission from STINNER Victor :

Random error seen on FreeBSD:

0:05:54 load avg: 5.75 [340/427/1] test_logging passed -- running: test_pydoc 
(34.4 sec)

Exception in thread Thread-25 (serve_forever):
Traceback (most recent call last):
  File "/usr/home/vstinner/python/master/Lib/threading.py", line 990, in 
_bootstrap_inner
self.run()
  File "/usr/home/vstinner/python/master/Lib/threading.py", line 928, in run
self._target(*self._args, **self._kwargs)
  File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 863, 
in serve_forever
asyncore.loop(poll_interval, map=self._map)
  File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 203, in loop
poll_fun(timeout, map)
  File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 144, in poll
r, w, e = select.select(r, w, e, timeout)
OSError: [Errno 9] Bad file descriptor

--
components: Tests
messages: 391057
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_logging: "OSError: [Errno 9] Bad file descriptor" logged on FreeBSD
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



[issue43752] [sqlite3] Fetching an empty value from date column raises ValueError

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 6f1e8ccffa5b1272a36a35405d3c4e4bbba0c082 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43752: Fix sqlite3 regression for zero-sized blobs with converters 
(GH-25228)
https://github.com/python/cpython/commit/6f1e8ccffa5b1272a36a35405d3c4e4bbba0c082


--

___
Python tracker 

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



[issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception

2021-04-14 Thread STINNER Victor


New submission from STINNER Victor :

The Python test runner (libregrtest) should mark a test as failed if a thread 
logs an unexpected exception, as already done with unraisable exception.

See for example bpo-43842 where test_logging logs the following exception, but 
the tes is marked as passed:

Exception in thread Thread-25 (serve_forever):
Traceback (most recent call last):
  File "/usr/home/vstinner/python/master/Lib/threading.py", line 990, in 
_bootstrap_inner
self.run()
  File "/usr/home/vstinner/python/master/Lib/threading.py", line 928, in run
self._target(*self._args, **self._kwargs)
  File "/usr/home/vstinner/python/master/Lib/test/test_logging.py", line 863, 
in serve_forever
asyncore.loop(poll_interval, map=self._map)
  File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 203, in loop
poll_fun(timeout, map)
  File "/usr/home/vstinner/python/master/Lib/asyncore.py", line 144, in poll
r, w, e = select.select(r, w, e, timeout)
OSError: [Errno 9] Bad file descriptor


Attached PR implements this change.

--
components: Tests
messages: 391059
nosy: vstinner
priority: normal
severity: normal
status: open
title: libregrtest: mark a test as failed if a thread logs an unexpected 
exception
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



[issue43752] [sqlite3] Fetching an empty value from date column raises ValueError

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you for the report and reproducer, Mariusz and thank you for the PR, 
Erlend.

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



[issue43841] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is a duplicate of https://bugs.python.org/issue43825.

--
nosy: +xtreak

___
Python tracker 

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



[issue43843] libregrtest: mark a test as failed if a thread logs an unexpected exception

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue43839] [easy] test_cmd_line: DeprecationWarning: invalid escape sequence \u

2021-04-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecation warnings in test cases

___
Python tracker 

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



[issue43841] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecation warnings in test cases

___
Python tracker 

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



[issue43844] [easy]

2021-04-14 Thread STINNER Victor


New submission from STINNER Victor :

:2: PendingDeprecationWarning: lib2to3 package is deprecated and may 
not be able to parse Python 3.10+

$ ./python -m test -v test_lib2to3
(...)
test_load_grammar_from_subprocess (lib2to3.tests.test_parser.TestPgen2Caching) 
... :2: PendingDeprecationWarning: lib2to3 package is deprecated and 
may not be able to parse Python 3.10+
ok
(...)
Tests result: SUCCESS

Command to only re-run this test:

./python -Werror -m test -v test_lib2to3 -m test_load_grammar_from_subprocess

--
messages: 391062
nosy: vstinner
priority: normal
severity: normal
status: open
title: [easy]

___
Python tracker 

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



[issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
title: [easy] -> [easy]  test_lib2to3 logs a PendingDeprecationWarning: lib2to3 
package is deprecated and may not be able to parse Python 3.10+

___
Python tracker 

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



[issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Tests
keywords: +easy, newcomer friendly
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



[issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy closed my issue bpo-43841 as a duplicate of this one. My message:

Does someone want to propose a fix?

$ ./python -m test -v test_collections 
(...)
test_issue_4920 (test.test_collections.TestCollectionABCs) ... 
/home/vstinner/python/master/Lib/test/test_collections.py:1518: 
DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(len(s), len(items) - 1)
ok
(...)
Tests result: SUCCESS


Warning introduced by PR 25209:

commit 453074c8daf996b1815a0cd2218f0dbf1801056c
Author: Stepan Sindelar 
Date:   Thu Apr 8 01:31:55 2021 +0200

Fix broken test for MutableSet.pop() (GH-25209)

Changes the test to not assert concrete result of pop, but just that it
was an item from the set, and that the set shrunk by one.

--
nosy: +vstinner
title: Deprecation warnings in test cases -> [easy] test_collections: 
DeprecationWarning: Please use assertEqual instead

___
Python tracker 

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



[issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b8509ffa82d393d9d4a0f5520edca057978bbd86 by Karthikeyan 
Singaravelan in branch 'master':
bpo-43825: Fix deprecation warnings in test_cmd_line and test_collections 
(GH-25380)
https://github.com/python/cpython/commit/b8509ffa82d393d9d4a0f5520edca057978bbd86


--

___
Python tracker 

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



[issue43265] [sqlite3] Improve backup error handling

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset c1ae7419975f7d664320f66ea3acc8663bbf76cf by Erlend Egeberg 
Aasland in branch 'master':
bpo-43265: Improve sqlite3.Connection.backup error handling (GH-24586)
https://github.com/python/cpython/commit/c1ae7419975f7d664320f66ea3acc8663bbf76cf


--

___
Python tracker 

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



[issue43825] [easy] test_collections: DeprecationWarning: Please use assertEqual instead

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Karthikeyan! Usually, I let core developers to merge their own PRs, but 
I created multiple "easy" issues about warnings in tests, and so I merged 
directly your fix to prevent contributors to propose similar fixes ;-)

--

___
Python tracker 

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



[issue43265] [sqlite3] Improve backup error handling

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:

Thank you.

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



[issue43825] Deprecation warnings in test_cmd_line and test_collections

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: [easy] test_collections: DeprecationWarning: Please use assertEqual 
instead -> Deprecation warnings in test_cmd_line and test_collections

___
Python tracker 

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



[issue43825] Deprecation warnings in test_cmd_line and test_collections

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

I also created bpo-43839 "[easy] test_cmd_line: DeprecationWarning: invalid 
escape sequence \u" which was closed as duplicate of this one.

--

___
Python tracker 

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



[issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows

2021-04-14 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Looks like there might be a 3.35.5 release in the near future: 
https://sqlite.org/forum/forumpost/d36426225c?t=h

--

___
Python tracker 

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



[issue43845] test_concurrent_futures leaks many dangling threads on FreeBSD

2021-04-14 Thread STINNER Victor


New submission from STINNER Victor :

test_idle_process_reuse_multiple() of test_concurrent_futures failed on AMD64 
FreeBSD Shared 3.x, but then passed when re-run in verbose mode.
https://buildbot.python.org/all/#/builders/483/builds/1073

Moreover, test_concurrent_futures leaked many dangling threads.


0:04:31 load avg: 1.95 [163/427/1] test_concurrent_futures failed (3 min 29 
sec) -- running: test_nntplib (2 min 17 sec)
Warning -- threading_cleanup() failed to cleanup 2 threads (count: 2, dangling: 
3)
Warning -- Dangling thread: <_ExecutorManagerThread(Thread-41, started 
34386025472)>
Warning -- Dangling thread: <_MainThread(MainThread, started 34374492160)>
Warning -- Dangling thread: 
Warning -- threading_cleanup() failed to cleanup -2 threads (count: 0, 
dangling: 1)
Warning -- Dangling thread: <_MainThread(MainThread, started 34374492160)>
(...)
==
FAIL: test_idle_process_reuse_multiple 
(test.test_concurrent_futures.ProcessPoolForkProcessPoolExecutorTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_concurrent_futures.py",
 line 1018, in test_idle_process_reuse_multiple
self.assertLessEqual(len(executor._processes), 2)
AssertionError: 3 not less than or equal to 2

Stdout:
0.43s 

--

Ran 226 tests in 209.441s

FAILED (failures=1, skipped=6)
test test_concurrent_futures failed
(...)
1 re-run test:
test_concurrent_futures

Total duration: 16 min 7 sec
Tests result: FAILURE then SUCCESS

--
components: Tests
messages: 391070
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_concurrent_futures leaks many dangling threads on FreeBSD
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



[issue43845] test_concurrent_futures leaks many dangling threads on FreeBSD

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

See also:

* bpo-39995: test_concurrent_futures: 
ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] 
Bad file descriptor
* bpo-35809: test_concurrent_futures.ProcessPoolForkExecutorDeadlockTest fails 
intermittently on Travis and passes in verbose mode

--

___
Python tracker 

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



[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon


New submission from Mark Shannon :

Large literals or function calls with many arguments can consume a lot of stack 
space.

This will be a problem for any future work to use a contiguous stack for data 
and possibly eliminate frame objects for most calls.

It is also possible (I haven't measured this) that this large stack consumption 
is hurting performance now, as it might leak memory by leaving giant frames in 
the free-list or as a zombie frame.

This fix relatively straightforward. For large literals and argument lists, 
build them incrementally rather than all at once.

--
assignee: Mark.Shannon
components: Interpreter Core
messages: 391072
nosy: Mark.Shannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Control stack usage in large expressions
type: performance

___
Python tracker 

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



[issue43834] Use context manager in StringIO example

2021-04-14 Thread John Hagen


Change by John Hagen :


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

___
Python tracker 

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



[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 3386ca0b36327afeef8d7eff277b2aed1030c08d by Erlend Egeberg 
Aasland in branch 'master':
bpo-20364: Improve sqlite3 placeholder docs (GH-25003)
https://github.com/python/cpython/commit/3386ca0b36327afeef8d7eff277b2aed1030c08d


--
nosy: +berker.peksag

___
Python tracker 

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



[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2021-04-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +24135
pull_request: https://github.com/python/cpython/pull/25402

___
Python tracker 

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



[issue43847] realpath of bytestr smb drive letters fail

2021-04-14 Thread ed


New submission from ed :

some win7sp1 and win10:20H2 boxes cannot realpath a networked drive letter such 
as b"n:" (also affects b"n:\\")
 * observed with 3.8.7 and 3.9.1
 * 3.7.9 is fine

requirements to trigger:
 * bytestring (not unicode str)
 * just the drive letter (subfolders are ok)
 * networked drive (regular disks and vmhgfs are ok)
 * enterprise/AD network? (doesn't seem to happen with samba)

hits the following exceptions in succession:
 * access denied at L601: "path = _getfinalpathname(path)"
 * "cant concat str to bytes" at L621: "return path + tail"

--
components: Windows
messages: 391074
nosy: 9001, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: realpath of bytestr smb drive letters fail
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings

2021-04-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I have reported this in the original issue earlier 
https://bugs.python.org/issue41282#msg388224 . See also 
https://bugs.python.org/issue43425 for more discussion over handling this.

--
nosy: +xtreak

___
Python tracker 

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



[issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

2021-04-14 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

I fixed this in https://github.com/python/cpython/pull/21694 . Somehow this 
seems to emit warning over full test run and not in individual case :( Is there 
a command to reproduce this always? I ran the command but it's successful for 
me and doesn't show the warning.

./python -Werror -m test -v test_lib2to3 -m test_load_grammar_from_subprocess
== CPython 3.10.0a7+ (heads/master:d9151cb453, Apr 13 2021, 03:10:47) [GCC 
7.5.0]
== Linux-4.15.0-99-generic-x86_64-with-glibc2.27 little-endian
== cwd: /root/cpython/build/test_python_20462æ
== CPU count: 1
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 0.02 Run tests sequentially
0:00:00 load avg: 0.02 [1/1] test_lib2to3
test_load_grammar_from_subprocess (lib2to3.tests.test_parser.TestPgen2Caching) 
... ok

--

Ran 1 test in 0.164s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 303 ms
Tests result: SUCCESS

--
nosy: +xtreak

___
Python tracker 

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



[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon


Change by Mark Shannon :


--
nosy: +pablogsal

___
Python tracker 

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



[issue43846] Control stack usage in large expressions

2021-04-14 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 95e4431804587a0c9d464bb7b3d5f3057bbeaccd by Miss Islington (bot) 
in branch '3.9':
bpo-20364: Improve sqlite3 placeholder docs (GH-25003)
https://github.com/python/cpython/commit/95e4431804587a0c9d464bb7b3d5f3057bbeaccd


--

___
Python tracker 

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



[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2021-04-14 Thread Berker Peksag


Change by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 19.0 -> 20.0
pull_requests: +24138
pull_request: https://github.com/python/cpython/pull/25405

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +24139
pull_request: https://github.com/python/cpython/pull/25406

___
Python tracker 

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



[issue43840] [easy] test_distutils logs 3 DeprecationWarning warnings

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, let's reuse bpo-41282.

I created PR 25405 and PR 25406.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate and remove distutils

___
Python tracker 

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



[issue43426] test_importlib.test_windows emits deprecation warning over usage of distutils

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:

It should be fixed by:

commit 1899087b21119c5c64cd41619b542c0bf0ab5751
Author: Brett Cannon 
Date:   Fri Mar 26 11:55:07 2021 -0700

bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)

--
nosy: +vstinner
resolution:  -> fixed
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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5bf8bf2267cd109970b2d946d43b2e9f71379ba2 by Pablo Galindo in 
branch 'master':
bpo-38530: Offer suggestions on NameError (GH-25397)
https://github.com/python/cpython/commit/5bf8bf2267cd109970b2d946d43b2e9f71379ba2


--

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-04-14 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 92eebf6dd20c541ca5883d010a575fb6ea4a245c by Petr Viktorin in 
branch 'master':
bpo-43795: Sort PC/python3dll.c (GH-25312)
https://github.com/python/cpython/commit/92eebf6dd20c541ca5883d010a575fb6ea4a245c


--

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-04-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d9ba9dee7f267a603394b8d63a7697b08efdf1cb by Victor Stinner in 
branch 'master':
bpo-41282: setup.py ignores distutils DeprecationWarning (GH-25405)
https://github.com/python/cpython/commit/d9ba9dee7f267a603394b8d63a7697b08efdf1cb


--

___
Python tracker 

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



[issue43844] [easy] test_lib2to3 logs a PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+

2021-04-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:

Making SQLITE_OMIT_AUTOINIT the default behavior would pretty much break every 
application that use SQLite, but since the PR is small enough and uses the 
interface in the correct way, I don't see a strong reason to reject it.

--

___
Python tracker 

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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset def919342facf7f53a3a5f0e9f4b1889d323956d by Erlend Egeberg 
Aasland in branch 'master':
bpo-43505: Explicitly initialize and shutdown sqlite3 (GH-25404)
https://github.com/python/cpython/commit/def919342facf7f53a3a5f0e9f4b1889d323956d


--

___
Python tracker 

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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43505] [sqlite3] Explicitly initialise and shut down sqlite3

2021-04-14 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

> Making SQLITE_OMIT_AUTOINIT the default behavior would pretty much break 
> every application that use SQLite [...]

Yeah, I know, _but_ if some user decides use a SQLite library compiled with 
SQLITE_OMIT_AUTOINIT (because it is mentioned in the "Recommended Compile-time 
Optinos"[1]), Python 3.10 won't break :)


[1] https://sqlite.org/compile.html

--

___
Python tracker 

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



[issue43836] range.index doesn't support start/stop optional arguments

2021-04-14 Thread Mark Dickinson


Mark Dickinson  added the comment:

Duplicate of #28197?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24141
pull_request: https://github.com/python/cpython/pull/25408

___
Python tracker 

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



[issue43798] Add position metadata to alias AST type

2021-04-14 Thread Florian Bruhin


Change by Florian Bruhin :


--
nosy: +The Compiler

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-04-14 Thread Petr Viktorin

Petr Viktorin  added the comment:


New changeset 341e8a939aca6e9f59ffb0e6daee5888933694ed by Lumír 'Frenzy' Balhar 
in branch 'master':
bpo-41282: (PEP 632) Load install schemes from sysconfig (GH-24549)
https://github.com/python/cpython/commit/341e8a939aca6e9f59ffb0e6daee5888933694ed


--
nosy: +petr.viktorin

___
Python tracker 

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



[issue43492] Upgrade to SQLite 3.35.4 in macOS and Windows

2021-04-14 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

As @steve.dower mentioned that maybe the SQLite team is busy fixing bugs and 
implementing features in SQLite 3.35. But @erlendaasland, 
https://sqlite.org/forum/forumpost/d36426225c?t=h has a question related to 
SQLite 3.35.5 but there was no reply or confirmation from the SQLite team. 
There maybe a direct SQLite 3.36.0 instead of 3.35.5. Moreover if n o bugs are 
found in the upcoming SQLite 3.35 release I think it's time to implement that 
version of SQLite to work with python/cpython or it'll be too late and SQLite 
3.36 may be released.

--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue43836] range.index doesn't support start/stop optional arguments

2021-04-14 Thread Kaleb Barrett


Kaleb Barrett  added the comment:

And so it is... There is also a PR open with a solution from 2017. 
https://github.com/python/cpython/pull/4378/files. Can this get reviewed?

The rationalizations against solving this bug stated in the original issue are 
weak, range.index *is* useful. I use range objects to describe alternate 
indexing schemes for an array type (to model HDL datatypes that allow arbitrary 
indexing schemes). range.index is used to translate user supplied indexes into 
0-based indexes to index into a parallel list with the array values.
https://github.com/cocotb/cocotb/pull/2510/files#diff-62a4545e5bbb9291f2bdb820609b2d68c69cbafe64faea83beb380d01c02fb5aR315-R319

Additionally, this causes issues with mypy. If you subclass Sequence, mypy will 
complain if you don't have the optional start and stop arguments in the index 
method. I would need to feed them into a range object in my implementation. I 
guess in my case I'm expected to just reject them? This breaks substitutability 
in my class.

It also breaks substitutability with list, tuples, every built-in Sequence type 
as well.

--

___
Python tracker 

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



[issue15795] Zipfile.extractall does not preserve file permissions

2021-04-14 Thread William Woodruff


Change by William Woodruff :


--
nosy: +yossarian

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e07f4ab26aaf08f90ebd9e6004af14fd6ef39351 by Pablo Galindo in 
branch 'master':
bpo-38530: Make sure that failing to generate suggestions on failure will not 
propagate exceptions (GH-25408)
https://github.com/python/cpython/commit/e07f4ab26aaf08f90ebd9e6004af14fd6ef39351


--

___
Python tracker 

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



[issue43836] range.index doesn't support start/stop optional arguments

2021-04-14 Thread Ammar Askar


Ammar Askar  added the comment:

Marked as a duplicate.

Kaleb, would you mind posting your comment on the original bug #28197?

--
nosy: +ammar2
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Add start and stop parameters to the range.index() ABC method

___
Python tracker 

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



[issue28197] Add start and stop parameters to the range.index() ABC method

2021-04-14 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue40407] Zipfile couldn`t recognized character set rightly.

2021-04-14 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +alanmcintyre, serhiy.storchaka, twouters

___
Python tracker 

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



[issue43583] make test failures, 2 tests failed: test_embed test_tabnanny

2021-04-14 Thread Irit Katriel


Irit Katriel  added the comment:

As Victor suggested in https://bugs.python.org/issue43001#msg386820:

Try to run directly the two failing tests in verbose mode, copy/paste the 
output into a file and attach the file here:

python -m test test_embed test_tabnanny -v

--
nosy: +iritkatriel

___
Python tracker 

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



[issue43848] gzip.py: explain optional argument mtime

2021-04-14 Thread Joachim


New submission from Joachim :

Explain the data type of optional argument mtime: seconds since the epoch.

As an alternative to mtime = None, recommend mtime = 0 for generating 
deterministic streams.

--
assignee: docs@python
components: Documentation
messages: 391093
nosy: docs@python, j5w6
priority: normal
severity: normal
status: open
title: gzip.py: explain optional argument mtime
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



[issue43252] deepcopy of weakref proxies

2021-04-14 Thread Irit Katriel


Irit Katriel  added the comment:

If you deep-copy the referents, what would hold a reference to them? Wouldn't 
the new objects be immediately GCed?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer

2021-04-14 Thread Michael Curran


Michael Curran  added the comment:

I can also reproduce this. I will attach my own testcase below.
So far I see it when the callback is __stdcall (WINFUNCTYPE) and it takes an 
larger than 4 bytes (E.g. a long long or a VARIANT), with one or more arguments 
preceeding it such that this argument is not aligned on a multiple of 8 bytes. 
For example arguments can be:
* long, long long
* long, long, long, long long
But the corruption does not occur with something like:
* long, long, long long
My testcase uses long, long long to show the crash.

--
nosy: +michaeldcurran
Added file: https://bugs.python.org/file49959/py3.8crash.zip

___
Python tracker 

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



[issue43848] gzip.py: explain optional argument mtime

2021-04-14 Thread Joachim


Change by Joachim :


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

___
Python tracker 

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



[issue38748] 32 bit ctypes stdcall callback fails to restore stack pointer

2021-04-14 Thread Michael Curran


Michael Curran  added the comment:

This bug is reproduceable on both Python 3.8 and 3.9. But not 3.7.
Ths bug is seen in the real world, in the context of providing Python callbacks 
to Win32 API functions, or when implementing comtypes COM objects in Python.
For example, we see this crash in the NVDA screen reader project, in our 
implementation of ITTSBufNotifySink from the Microsoft SAPI4 speech API.
ITTSBufNotifySink::TextDataStarted takes a pointer (this), and a long long 
(qTimestamp).
https://github.com/nvaccess/nvda/issues/12152

--

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread Brett Cannon


Brett Cannon  added the comment:

Are you still planning to fix this, Barry?

--

___
Python tracker 

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



[issue43849] Typo in calendar doc

2021-04-14 Thread John


New submission from John :

I believe the parenthesis in 

calendar.firstweekday()

should be removed. As it is, it produces 'int' cannot be called.

--
assignee: docs@python
components: Documentation
messages: 391098
nosy: JohnCC330, docs@python
priority: normal
severity: normal
status: open
title: Typo in calendar doc
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



[issue43849] Typo in calendar doc

2021-04-14 Thread John


John  added the comment:

Sorry for the noise. My confusion.

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



[issue43296] [sqlite3] Fix sqlite3_value_blob() usage

2021-04-14 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 5cb601f956886b32641f818b5da347cc86a43db2 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43296: Handle sqlite3_value_blob() errors (GH-24674)
https://github.com/python/cpython/commit/5cb601f956886b32641f818b5da347cc86a43db2


--

___
Python tracker 

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



[issue43296] [sqlite3] Fix sqlite3_value_blob() usage

2021-04-14 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43296] [sqlite3] Fix sqlite3_value_blob() usage

2021-04-14 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Thanks, Berker!

I'll add separate issues for sqlite3_value_text() and the missing 
PyTuple_SetItem() error checks.

--

___
Python tracker 

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



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

I'd still like to.  I'm also happy to review any PRs if someone beats me to it.

--

___
Python tracker 

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



[issue32935] Documentation falsely leads to believe that MemoryHandler can be used to wrap SMTPHandler to send multiple messages per email

2021-04-14 Thread Irit Katriel


Irit Katriel  added the comment:

The documentation does talk about emit() operating on single records:

https://docs.python.org/3/library/logging.handlers.html#logging.handlers.BufferingHandler.emit

How would you make this clearer?

--
nosy: +iritkatriel
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

New submission from Filipe Laíns :

Currently, the order of set or frozenset elements when saved to bytecode is 
dependent on the random seed. This breaks reproducibility.

Example fail from an Arch Linux package: 
https://reproducible.archlinux.org/api/v0/builds/88454/diffoscope

Let's take an example file, `test_compile.py`
```python
s = {
'aaa',
'bbb',
'ccc',
'ddd',
'eee',
}
```

$ PYTHONHASHSEED=0 python -m compileall --invalidation-mode checked-hash 
test_compile.py
$ mv __pycache__ __pycache__1
$ PYTHONHASHSEED=1 python -m compileall --invalidation-mode checked-hash 
test_compile.py

$ diff __pycache__/test_compile.cpython-39.pyc 
__pycache__1/test_compile.cpython-39.pyc
Binary files __pycache__/test_compile.cpython-39.pyc and 
__pycache__1/test_compile.cpython-39.pyc differ

$ diff <(xxd __pycache__/test_compile.cpython-39.pyc) <(xxd 
__pycache__1/test_compile.cpython-39.pyc)
5,6c5,6
< 0040: 005a 0362 6262 5a03 6464 645a 0361 6161  .Z.bbbZ.dddZ.aaa
< 0050: 5a03 6363 635a 0365 6565 4e29 01da 0173  Z.cccZ.eeeN)...s
---
> 0040: 005a 0361 6161 5a03 6363 635a 0364 6464  .Z.aaaZ.cccZ.ddd
> 0050: 5a03 6565 655a 0362 6262 4e29 01da 0173  Z.eeeZ.bbbN)...s

I believe the issue is in the marshall module. Particularly, this line[1]. My 
simple fix was to create a list from the set, sort it, and iterate over it 
instead.

[1] 
https://github.com/python/cpython/blob/00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0/Python/marshal.c#L505

--
messages: 391104
nosy: FFY00, Mark.Shannon, benjamin.peterson, yselivanov
priority: normal
severity: normal
status: open
title: unreproducible bytecode: set order depends on random seed for compiled 
bytecode
type: behavior

___
Python tracker 

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



[issue40804] Bug report in python3.6.8 using argparse module

2021-04-14 Thread Irit Katriel


Irit Katriel  added the comment:

amansi26, I am closing this because you did not reply to the request for more 
information for almost a year. Also, the link in your comment is not working 
anymore. 

If you are still having a problem with argparse, please open a new issue for it 
and include code that demonstrates the problem.

There is some documentation on bug reporting that might be helpful:
https://docs.python.org/3/bugs.html#using-the-python-issue-tracker

--
nosy: +iritkatriel
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

Change by Filipe Laíns :


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

___
Python tracker 

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



[issue43850] unreproducible bytecode: set order depends on random seed for compiled bytecode

2021-04-14 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue43837] Operator precedence documentation could be more clear

2021-04-14 Thread Aidan Feldman


Aidan Feldman  added the comment:

Let me try and say a simpler way: I think "variables" should be mentioned in 
that section, either in the table or the paragraph above.

--

___
Python tracker 

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



[issue38530] Offer suggestions on AttributeError and NameError

2021-04-14 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +24144
pull_request: https://github.com/python/cpython/pull/25412

___
Python tracker 

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



[issue43837] Operator precedence documentation could be more clear

2021-04-14 Thread Zachary Ware


Zachary Ware  added the comment:

I think it might be easiest to see your suggestion as a pull request :)

--
nosy: +zach.ware

___
Python tracker 

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



  1   2   >