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

2021-04-13 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +24126 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25393 ___ Python tracker ___ __

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

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: > ./python -m pyperf timeit "from functools import lru_cache; f = > lru_cache(lambda: 42)" "f()" --compare-to ../3.9/python > /home/pablogsal/github/3.9/python: . 2.60 us +- 0.05 us You misused pyperf timeit: the two statements are run at

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

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: I wrote PR 25393 to micro-optimize _PyType_GetModuleByDef(). It reduces the overhead from +5.7 ns to +3.4 ns (-2.3 ns). Well, I didn't check in depth if _PyType_GetModuleByDef() is the only change in functools.lru_cache() from Python 3.9 to master. Compare

[issue43835] Dataclasses don't call base class __init__

2021-04-13 Thread Paul Pinterits
New submission from Paul Pinterits : It's documented behavior that @dataclass won't generate an __init__ method if the class already defines one. It's also documented that a dataclass may inherit from another dataclass. But what happens if you inherit from a dataclass that implements a custom

[issue43725] Create a release branch ABI stability regression test

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: > Ok, then we need to revert by latest 2 PRs and add a new label or something > to skip To skip ABI tests? I proposed to ignore ABI changes if they can be ignored safely. But I don't know right now which changes can be ignored or not. -- __

[issue43725] Create a release branch ABI stability regression test

2021-04-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > To skip ABI tests? I proposed to ignore ABI changes if they can be ignored > safely. But I don't know right now which changes can be ignored or not. As the situation stands we need to choose on keeping my changes to ignore _Py function changes or re

[issue43725] Create a release branch ABI stability regression test

2021-04-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > $ objdump -T /lib64/libpython3.10.so.1.0|grep > _Py_M__importlib_bootstrap_external # empty output This was happening on 3.8 Victor: root@d9c5942e274b:/src# objdump -T libpython3.8.so | grep _Py_M__importlib_bootstrap_external 00335740 g

[issue43725] Create a release branch ABI stability regression test

2021-04-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I am going to revert the 3.9 PR as 3.9+ is hiding symbols by default. -- ___ Python tracker ___ __

[issue43725] Create a release branch ABI stability regression test

2021-04-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +24127 pull_request: https://github.com/python/cpython/pull/25394 ___ Python tracker ___ ___

[issue43725] Create a release branch ABI stability regression test

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: > I got a false positive on my PR at > https://github.com/python/cpython/pull/25318/checks?check_run_id=2308871807 Oh, this CI failure was on Python 3.8. Since Python 3.9, Python is now built with -fvisibility=hidden to avoid exporting symbols which are not

[issue43810] os.path.abspath returns invalid path (resolves symbolic link)

2021-04-13 Thread Eryk Sun
Eryk Sun added the comment: If realpath() resolves too much, you'll have to resolve manually via os.path.islink() and os.readlink(). If you need strict resolution, use pathlib.Path.resolve(). In strict mode it raises FileNotFoundError if a path component doesn't exist. Also, even in non-stri

[issue43785] Remove RLock from BZ2File

2021-04-13 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue43785] Remove RLock from BZ2File

2021-04-13 Thread Inada Naoki
Inada Naoki added the comment: New changeset 695d47b51e3e197de5448a1eb2f618bef6d59ac8 by Inada Naoki in branch 'master': bpo-43785: Update bz2 document (GH-25351) https://github.com/python/cpython/commit/695d47b51e3e197de5448a1eb2f618bef6d59ac8 -- __

[issue43835] Dataclasses don't call base class __init__

2021-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: dataclasses doesn't know the signature of the base class's __init__, so it can't know how to call it. I realize you've given an example that would accept any parameters, but that isn't typical. What if the base class was: @dataclasses.dataclass class Foo:

[issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...")

2021-04-13 Thread Eryk Sun
Eryk Sun added the comment: > So that means we can close the issue, no? This is a bug in 3.8 and 3.9, which need the fix to keep reading until "\n" is seen on the line. I arrived at this issue via bpo-38755 if you think it should be addressed there, but it's the same bug that's reported here

[issue43731] PEP 597: logging.fileConfig() uses locale encoding.

2021-04-13 Thread Inada Naoki
Inada Naoki added the comment: > Ah, so you want to emit an EncodingWarning when fileConfig(filename) is > called without specifying an encoding, right? Yes, but only when the user uses `PYTHONWARNDEFAULTENCODING`. I already added `export PYTHONWARNDEFAULTENCODING=1` in `.bashrc` in my mac a

[issue14811] decoding_fgets() truncates long lines and fails with a SyntaxError("Non-UTF-8 code starting with...")

2021-04-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Ok, let's continue the discussion on https://bugs.python.org/issue38755 -- ___ Python tracker ___

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: The bpo-14811 issue was fixed in Python 3.10 by bpo-25643, but is not fixed in Python 3.8 and 3.9. -- nosy: +vstinner ___ Python tracker ___

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: In 2012, I wrote detect_truncate.patch in bpo-14811. Does someone want to convert it to a PR for Python 3.9? -- ___ Python tracker ___ _

[issue43080] pprint for dataclass instances

2021-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 11159d2c9d6616497ef4cc62953a5c3cc8454afb by Lewis Gaul in branch 'master': bpo-43080: pprint for dataclass instances (GH-24389) https://github.com/python/cpython/commit/11159d2c9d6616497ef4cc62953a5c3cc8454afb -- __

[issue43080] pprint for dataclass instances

2021-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for all of the work, LewisGaul. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue43835] Dataclasses don't call base class __init__

2021-04-13 Thread Paul Pinterits
Paul Pinterits added the comment: > dataclasses doesn't know the signature of the base class's __init__, so it > can't know how to call it. The dataclass doesn't need to know what arguments the parent __init__ accepts. It should consume the arguments it needs to initialize its instance attri

[issue43835] Dataclasses don't call base class __init__

2021-04-13 Thread Eric V. Smith
Eric V. Smith added the comment: > The dataclass doesn't need to know what arguments the parent __init__ > accepts. It should consume the arguments it needs to initialize its instance > attributes, and forward the rest to the parent __init__. The generated __init__() uses every parameter to

[issue43682] Make static methods created by @staticmethod callable

2021-04-13 Thread Inada Naoki
Inada Naoki added the comment: Strictly speaking, adding any method is "potential" breaking change because hasattr(obj, "new_method") become from False to True. And since Python is dynamic language, any change is "potential" breaking change. But we don't treat such change as breaking change.

[issue43680] Remove undocumented io.OpenWrapper and _pyio.OpenWrapper

2021-04-13 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +24128 pull_request: https://github.com/python/cpython/pull/25395 ___ Python tracker ___ _

[issue43680] Remove undocumented io.OpenWrapper and _pyio.OpenWrapper

2021-04-13 Thread STINNER Victor
STINNER Victor added the comment: New changeset 3bc694d5f3d4eb2e5d2f0b83e498b19662845d4e by Victor Stinner in branch 'master': bpo-43680: Deprecate io.OpenWrapper (GH-25357) https://github.com/python/cpython/commit/3bc694d5f3d4eb2e5d2f0b83e498b19662845d4e -- ___

[issue43680] Deprecate undocumented io.OpenWrapper and _pyio.OpenWrapper

2021-04-13 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: Remove undocumented io.OpenWrapper and _pyio.OpenWrapper -> Deprecate undocumented io.OpenWrapper and _pyio.OpenWrapper ___ Python trac

[issue38530] Offer suggestions on AttributeError

2021-04-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 37494b441aced0362d7edd2956ab3ea7801e60c8 by Pablo Galindo in branch 'master': bpo-38530: Offer suggestions on AttributeError (#16856) https://github.com/python/cpython/commit/37494b441aced0362d7edd2956ab3ea7801e60c8 --

[issue38530] Offer suggestions on AttributeError and NameError

2021-04-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- title: Offer suggestions on AttributeError -> Offer suggestions on AttributeError and NameError ___ Python tracker ___ ___

[issue38530] Offer suggestions on AttributeError and NameError

2021-04-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +24129 pull_request: https://github.com/python/cpython/pull/25397 ___ Python tracker ___ ___

[issue43828] MappingProxyType accepts string

2021-04-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: This isn't a bug because the MappingProxy doesn't promise to do early detection and because it can't really be accomplished cleanly. Perfect detection of non-mappings isn't possible. Some easy, minimal checks are made for early detection using PyMapping_

[issue43829] MappingProxyType cannot hash a hashable underlying mapping

2021-04-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, what do you think? Would it make sense to pass through the underlying hash? I don't think there is much use for this but don't see any particular reason to block it. -- nosy: +rhettinger, serhiy.storchaka priority: normal -> low versions

[issue43813] Denial of service on http.server module with large request method.

2021-04-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

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

2021-04-13 Thread Kaleb Barrett
New submission from Kaleb Barrett : The range builtin type is a collections.abc.Sequence, which in Python 3.5 added the optional start and stop arguments to the index method of Sequences. However, range.index does not support these optional arguments required by Sequence. I noticed this when

[issue32891] Add 'Integer' as synonym for 'Integral' in numbers module.

2021-04-13 Thread Sergey B Kirpichev
Change by Sergey B Kirpichev : -- nosy: +Sergey.Kirpichev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue43837] Operator precedence documentation could be more clear

2021-04-13 Thread Aidan Feldman
New submission from Aidan Feldman : I am teaching a class on Python for people who are new to coding, and I was talking them through the operator precedence table: https://docs.python.org/3/reference/expressions.html#operator-precedence A couple things that confused the students: - "Highest

[issue43777] Remove description of "pip search" command from tutorial

2021-04-13 Thread Inada Naoki
Inada Naoki added the comment: New changeset 133705b85cc25d1e6684d32f8943ca288fadfda0 by Bob Kline in branch 'master': bpo-43777: Drop description of "pip search" command from tutorial (GH-25287) https://github.com/python/cpython/commit/133705b85cc25d1e6684d32f8943ca288fadfda0 -- _

[issue43777] Remove description of "pip search" command from tutorial

2021-04-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24130 pull_request: https://github.com/python/cpython/pull/25398 ___ Python tracker _

[issue43777] Remove description of "pip search" command from tutorial

2021-04-13 Thread miss-islington
Change by miss-islington : -- pull_requests: +24131 pull_request: https://github.com/python/cpython/pull/25399 ___ Python tracker ___ __

[issue43712] PEP 597: fileinput uses locale encoding

2021-04-13 Thread Inada Naoki
Inada Naoki added the comment: New changeset 333d10cbb53dd5f28d76f659a49bf0735f8509d8 by Inada Naoki in branch 'master': bpo-43712 : fileinput: Add encoding parameter (GH-25272) https://github.com/python/cpython/commit/333d10cbb53dd5f28d76f659a49bf0735f8509d8 -- ___

[issue43712] PEP 597: fileinput uses locale encoding

2021-04-13 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue5758] fileinput.hook_compressed returning bytes from gz file

2021-04-13 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Py

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

2021-04-13 Thread Inada Naoki
Inada Naoki added the comment: May I close this issue? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue41098] Deprecating PyUnicodeEncodeError_Create

2021-04-13 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue42578] Add tip when encountering UnicodeDecode/EncodeError in open()

2021-04-13 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bug

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

2021-04-13 Thread Lumír Balhar
Change by Lumír Balhar : -- nosy: +frenzy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue43733] PEP 597: netrc uses locale encoding.

2021-04-13 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue43777] Remove description of "pip search" command from tutorial

2021-04-13 Thread miss-islington
miss-islington added the comment: New changeset 6ac1ea25a2ba2aae742e191784cf73033b3ab332 by Miss Islington (bot) in branch '3.8': bpo-43777: Drop description of "pip search" command from tutorial (GH-25287) https://github.com/python/cpython/commit/6ac1ea25a2ba2aae742e191784cf73033b3ab332 --

[issue43777] Remove description of "pip search" command from tutorial

2021-04-13 Thread miss-islington
miss-islington added the comment: New changeset 57873af35aad98c6428b1718aaee4b16a82ea3f5 by Miss Islington (bot) in branch '3.9': bpo-43777: Drop description of "pip search" command from tutorial (GH-25287) https://github.com/python/cpython/commit/57873af35aad98c6428b1718aaee4b16a82ea3f5 --

[issue43777] Remove description of "pip search" command from tutorial

2021-04-13 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue43828] MappingProxyType accepts string

2021-04-13 Thread Andy Maier
Andy Maier added the comment: I accept that the issue was closed, but wanted to document some things: 1. The dict class manages very well to detect that a string is invalid input: >>> d = dict('abc') Traceback (most recent call last): File "", line 1, in ValueError: dictionary update seque

<    1   2