Inada Naoki added the comment:
I created another topic relating this issue.
https://discuss.python.org/t/add-legacy-text-encoding-option-to-make-utf-8-default/14281
If we add another option (e.g. legacy_text_encoding), we do not need to change
UTF-8 mode behavior
Inada Naoki added the comment:
Thank you. I agree that inlining is worth enough.
But we already inlined too many functions in ceval and there is an issue caused
by it... (bpo-45116)
--
___
Python tracker
<https://bugs.python.org/issue47
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +30091
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/32003
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
> As you can see, the location of the failing test in the log is masked, and
> instead the description is present.
Could you elaborate?
```
test_index_empty (idlelib.idle_test.test_text.MockTextTest)
Failing test with bad description. ... ERROR
Change by Inada Naoki :
--
pull_requests: +30132
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32042
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
I'm sorry. Maybe, ccache hides the warning from me.
--
___
Python tracker
<https://bugs.python.org/issue46864>
___
___
Pytho
Inada Naoki added the comment:
Since Python 3.13, yes. It will be bit slower.
--
___
Python tracker
<https://bugs.python.org/issue46864>
___
___
Python-bug
Inada Naoki added the comment:
Since the hash is randomized, using hash(bytes) for such use case is not
recommended. User should use stable hash functions instead.
I agree that there is few use cases this change cause performance regression.
But it is really few compared to overhead of
Inada Naoki added the comment:
> * sys.getfilesystemencoding(): Python filesystem encoding, return "UTF-8" if
> the Python UTF-8 Mode is enabled
Yes, althoguh PYTHONLEGACYWINDOWSFSENCODING takes priority.
> * locale.getencoding(): Get the locale encoding, LC_CTYPE locale
Change by Inada Naoki :
--
pull_requests: +30157
pull_request: https://github.com/python/cpython/pull/32068
___
Python tracker
<https://bugs.python.org/issue47
Inada Naoki added the comment:
Average RAM capacity doesn't grow as CPU cores grows.
Additionally, L1+L2 cache is really limited resource compared to CPU or RAM.
Bytes object is used for co_code that is hot. So cache efficiency is important.
Would you give us more realistic (or real
Inada Naoki added the comment:
New changeset 894d0ea5afa822c23286e9e68ed80bb1122b402d by Inada Naoki in branch
'main':
bpo-46864: Suppress deprecation warnings for ob_shash. (GH-32042)
https://github.com/python/cpython/commit/894d0ea5afa822c23286e9e68ed80b
Inada Naoki added the comment:
I am not sure about we really need "locale encoding at Python startup".
For this issue, I don't want to change `encoding="locale"` behavior except
ignore UTF-8 mode. So what I want is "current locale encoding" or
ANSI code
Inada Naoki added the comment:
First of all, this is just deprecating direct access of `ob_shash`. This makes
users need to use `PyObject_Hash()`.
We don't make the final decision about removing it. We just make we can remove
it in Python 3.13.
RAM and CACHE efficiency is not the
Inada Naoki added the comment:
> I guess not much difference in benchmarks.
> But if put a bytes object into multiple dicts/sets, and len(bytes_key) is
> large, it will take a long time. (1 GiB 0.40 seconds on i5-11500 DDR4-3200)
> The length of bytes can be arbitrary,so computing
Inada Naoki added the comment:
OK. Cache efficiency is dropped from motivations list.
Current motivations are:
* Memory saving (currently, 4 BytesObject (= 32 bytes of ob_shash) per code
object.
* Make bytes objects immutable
* Share objects among multi interpreters.
* CoW efficiency.
I
Inada Naoki added the comment:
@vstiner Since UTF-8 mode affects `locale.getpreferredencoding(False)`, I need
to decide alternative API in the PEP 686.
If no objections, I will choose `locale.get_encoding()` for current locale
encoding (ACP on Windows).
See https://github.com/python/peps
Inada Naoki added the comment:
> Please see https://bugs.python.org/issue47000#msg415769 for what Victor
> suggested.
Of course, I read it.
> In particular, the locale module uses the "no underscore" convention.
> Not sure whether it's good to start using snake c
Inada Naoki added the comment:
New changeset 4216dce04b7d3f329beaaafc82a77c4ac6cf4d57 by Inada Naoki in branch
'main':
bpo-47000: Make `io.text_encoding()` respects UTF-8 mode (GH-32003)
https://github.com/python/cpython/commit/4216dce04b7d3f329beaaafc82a77c
Inada Naoki added the comment:
It's just an implementation detail. Python implementation and C implementation
behave slightly different. But user program shouldn't rely on the detail.
Why do you think implementation details should be declared?
Who needs the information?
-
Inada Naoki added the comment:
New changeset 43d564c18c97421f73025ac3132a194975c76bd6 by Inada Naoki (Zackery
Spytz) in branch 'master':
bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (GH-14814)
https://github.com/python/cpython/commit/43d564c18c97421f73025ac3132a19
Inada Naoki added the comment:
When updating pip next time, please update setuptools too.
https://setuptools.readthedocs.io/en/latest/history.html#v41-1-0
> #1788: Changed compatibility fallback logic for html.unescape to avoid
> accessing HTMLParser.unescape when not nec
Inada Naoki added the comment:
thanks
--
nosy: +inada.naoki
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset fae0ed5099de594a9204071d555cb8b76368cbf4 by Inada Naoki in branch
'master':
bpo-37328: remove deprecated HTMLParser.unescape (GH-14186)
https://github.com/python/cpython/commit/fae0ed5099de594a9204071d555cb8
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Inada Naoki :
--
pull_requests: +15267
pull_request: https://github.com/python/cpython/pull/15591
___
Python tracker
<https://bugs.python.org/issue37
Inada Naoki added the comment:
@mpaolini I don't have enough time in these weeks. Would you try PR-15591?
I confirmed up to 4x speedup. But I'm afraid about there is performance
regression in simple cases.
--
___
Python track
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +15294
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15626
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
New changeset d765d81b8fb5ab707bfe8b079348e5038c298aa3 by Inada Naoki in branch
'master':
bpo-37781: use "z" for PY_FORMAT_SIZE_T (GH-15156)
https://github.com/python/cpython/commit/d765d81b8fb5ab707bfe
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset 013e52fd340d9ef558013b546f25456f94ee1804 by Inada Naoki in branch
'master':
bpo-37990: fix gc stats (GH-15626)
https://github.com/python/cpython/commit/013e52fd340d9ef558013b546f2545
Change by Inada Naoki :
--
pull_requests: +15295
pull_request: https://github.com/python/cpython/pull/15627
___
Python tracker
<https://bugs.python.org/issue37
Inada Naoki added the comment:
New changeset 97a31c7b486c45ba9c21cab5fb96337859a60275 by Inada Naoki in branch
'3.8':
[3.8] bpo-37990: fix gc stats (GH-15626)
https://github.com/python/cpython/commit/97a31c7b486c45ba9c21cab5fb9633
Inada Naoki added the comment:
Thank you for finding it!
My eyes were too focused on portability issue of "%zd"...
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<h
New submission from Inada Naoki :
See TOC in https://docs.python.org/3.7/whatsnew/changelog.html
Some releases (*) have multiple "Library" and "Security" sections.
(*) e.g. 3.6.0a3, 3.6.0a2, 3.6.0a1, 3.5.3rc1, 3.5.2rc1
--
assignee: docs@python
components: Do
Change by Inada Naoki :
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue38006>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Inada Naoki :
Reported here:
https://github.com/python/cpython/commit/feaefc7f60cd3be7bf4ecc2b73e77d2bfe048403
I merged GH-5351 but it broke inspect.getattr_static behavior. It should be
reverted.
--
components: Library (Lib)
keywords: 3.8regression
messages
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +15336
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/15676
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
New changeset 8f9cc8771ffb8d0e21be287eaed42ae06087acca by Inada Naoki in branch
'master':
bpo-38026: fix inspect.getattr_static (GH-15676)
https://github.com/python/cpython/commit/8f9cc8771ffb8d0e21be287eaed42a
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
I'm OK to revert it in 3.8.
But I am worrying about func.func_closure. Can it create cyclic reference in
real life applications?
--
___
Python tracker
<https://bugs.python.org/is
Change by Inada Naoki :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue36869>
___
Inada Naoki added the comment:
$ ./python -m pyperf timeit --compare-to ./python-master 'dict()'
python-master: . 89.9 ns +- 1.2 ns
python: . 72.5 ns +- 1.6 ns
Mean +- std dev: [python-master] 89.9 ns +- 1.2 ns -> [python] 72.5 ns +- 1
Inada Naoki added the comment:
New changeset 42acb7b8d29d078bc97b0cfd7c4911b2266b26b9 by Inada Naoki
(HongWeipeng) in branch 'master':
bpo-35696: Simplify long_compare() (GH-16146)
https://github.com/python/cpython/commit/42acb7b8d29d078bc97b0cfd7c4911b2266b26b9
-
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.8
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
On Mon, Oct 7, 2019 at 9:41 PM Mark Shannon wrote:
>
> Mark Shannon added the comment:
>
> Given that
> def foo(): int; str; bytes; float; int; str; bytes; float
> can be trivially be rewritten as
> def foo(): pass
> I think that benchma
New submission from Inada Naoki :
Reported on mailing list:
https://mail.python.org/archives/list/d...@python.org/thread/NIXFQMWFNSNO6RXPINY56CQQ5L7QIRUV/
qmail.org is dead. The mailbox doc [1] contains two links to man pages in
qmail.org.
Can we just remove them?
[1] https
Change by Inada Naoki :
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue38477>
___
___
Python-bugs-list mailing list
Unsubscribe:
Inada Naoki added the comment:
I can not confirm performance regression in 3.8.0.
$ time ~/pyenv/versions/3.7.3/bin/python permutations2x2 --max_depth 6 | egrep
"^# Total_Time" ; time ~/pyenv/versions/3.8.0/bin/python permutations2x2
--max_depth 6 | egrep "^# Total_Time"
Inada Naoki added the comment:
Ah, my bad. I meant `perf stat python ...`.
--
___
Python tracker
<https://bugs.python.org/issue38477>
___
___
Python-bugs-list m
Inada Naoki added the comment:
Deadsneak Python 3.8:
>>> sysconfig.get_config_var('CFLAGS')
'-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g
-fstack-protector-strong -Wformat -Werror=format-security'
Disco /usr/bin/python3.7:
>>
Change by Inada Naoki :
--
nosy: +inada.naoki
___
Python tracker
<https://bugs.python.org/issue38373>
___
___
Python-bugs-list mailing list
Unsubscribe:
Inada Naoki added the comment:
Space is not trimmed. You can confirm there is a space by copy&paste it from
rendered HTML.
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)¶
So this is caused by rendering sep=' '.
I don't like , but
Inada Naoki added the comment:
https://github.com/sphinx-doc/sphinx/pull/6401/files
Recent Sphinx uses .
So we can add style like this:
.sig-paren {
font-family: monospace, sans-serif;
font-style: normal;
}
--
___
Python tracker
Inada Naoki added the comment:
New changeset 9c11029bb41caab5576f354fbf808a5e91325bb0 by Inada Naoki in branch
'master':
bpo-37587: json: Use _PyUnicodeWriter when scanning string. (GH-15591)
https://github.com/python/cpython/commit/9c11029bb41caab5576f354fbf808a
Inada Naoki added the comment:
It is "universal newline".
See
https://docs.python.org/3/library/functions.html#open
and
https://docs.python.org/3/glossary.html#term-universal-newlines
--
nosy: +inada.naoki
resolution: -> not a bug
stage: -> resolved
status
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
When dict is empty, di_pos of reverse iterator must be -1, not 0.
Additionally, di_pos must be initialized from ma_used when dict is key sharing
dict.
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 64876e0519..6c4b41700b 100644
--- a/Objects
Inada Naoki added the comment:
> Strangely enough, it worked in Python 2.7
It is not strange since dict.keys() in Python 2.7 returns list.
>>> {}.viewkeys() | Ror()
Traceback (most recent call last):
File "", line 1, in
TypeError: itera
Inada Naoki added the comment:
> but it's not that simple as the __or__ of dictviews is less strict that the
> __or__ of set: __or__ of dictview accept any iterable, __or__ of set only
> accepts sets.
I want to make it same to set.
But it is a backwar
Inada Naoki added the comment:
I want to remove them in 3.10 too.
If we chose the annual release cycle, I'm OK to postpone the removal to 3.11.
FWIW, ujson is apopular extension that uses these APIs.
But it is not maintained for a long time, and there are many alternative JSON
libr
New submission from Inada Naoki :
-, |, and ^ of dictkeys are implemented as:
PyObject *result = PySet_New(self);
// Call set.difference_update, set.update, set.symmetric_difference_update with
other.
PySet_New(iterable) has optimized step for iterable is dict.
But since iterable is dictkeys
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +16489
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16961
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
> How does it work with dict subclasses?
PySet_New(iterable) uses fast path only when `PyDict_CheckExact(iterable)` is
true.
So there is no change for dict subclasses.
--
___
Python tracker
<
Inada Naoki added the comment:
done.
--
___
Python tracker
<https://bugs.python.org/issue38613>
___
___
Python-bugs-list mailing list
Unsubscribe:
Inada Naoki added the comment:
New changeset 6cbc84fb99acb33dd659d7adb29a20adbe62b74a by Inada Naoki in branch
'master':
bpo-38613: Optimize set operations of dict keys. (GH-16961)
https://github.com/python/cpython/commit/6cbc84fb99acb33dd659d7adb29a20
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Inada Naoki :
--
superseder: -> Use io.open_code for .pth files
___
Python tracker
<https://bugs.python.org/issue43214>
___
___
Python-bugs-list mai
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +23602
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24837
___
Python tracker
<https://bugs.python.org/issu
New submission from Inada Naoki :
They are documented as "will be removed in 4.0" now.
--
components: C API
messages: 388800
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 624: Update document for removal schedule
versions: Python 3.10,
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +23646
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24885
___
Python tracker
<https://bugs.python.org/issu
New submission from Inada Naoki :
PEP 597 is accepted.
--
components: IO
messages: 388809
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: Implemente encoding="locale" option and EncodingWarning
versions: P
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
New changeset 1330338583d183250186a8123b99d2283e945b4f by Inada Naoki in branch
'master':
bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885)
https://github.com/python/cpython/commit/1330338583d183250186a8123b99d2
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +23653
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19481
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
New changeset dc8558ef302f1b14b45c21abd7451e4fb56b4604 by Miss Islington (bot)
in branch '3.8':
bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885)
https://github.com/python/cpython/commit/dc8558ef302f1b14b45c21abd7451e
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
PEP 597 is accepted. May I close this?
--
___
Python tracker
<https://bugs.python.org/issue42578>
___
___
Python-bugs-list mailin
Inada Naoki added the comment:
locale-specific encoding is not good especially for Windows.
But we used it for a long time. Changing the encoding for pth files is breaking
change.
--
resolution: -> not a bug
stage: patch review -> resolved
status: open -&g
Inada Naoki added the comment:
> I created this issue while reviewing the implementation of the PEP 597: PR
> 19481.
What I want is same to `locale.getpreferredencoding(False)` but ignores UTF-8
mode.
Background: PEP 597 adds new `encoding="locale"`option to open() and
Tex
Inada Naoki added the comment:
> Is it about the current implementation of the PEP 597, or are you thinking at
> the future Python which would use UTF-8 by default?
I had forgot to consider about UTF-8 mode while finishing PEP 597. If possible,
I want to ignore UTF-8 mode when `en
Inada Naoki added the comment:
> Since the final goal is to move everybody towards to UTF-8, I'm not sure how
> it's a good thing.
The final goal (the third motivation of the pep 597) is changing the default
encoding (i.e. encoding used when it is not specified) to UTF
Inada Naoki added the comment:
> (1) "UTF-8" in the UTF-8 Mode, or the locale encoding
> (2) Always use the locale encoding, ignore the UTF-8 Mode
>
> What I don't expect is the current behavior, before PEP 597. Who uses open()
> without specifying an encod
Inada Naoki added the comment:
> Please address UTF-8 mode explicitly in open() or elsewhere. The locale
> module is about the state of the lib C, not what Python enforces via
> options in its own I/O layers.
I agree with you. APIs in locale module shouldn't aw
Inada Naoki added the comment:
> Why is it being specified that the current LC_CTYPE encoding should be
> ignored in Windows when a "locale" encoding is requested?
Because `encoding="locale"` must be replacement of the current `encoding=None`
(i.e. locale.
Change by Inada Naoki :
--
pull_requests: +23808
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25060
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
New changeset 4827483f47906fecee6b5d9097df2a69a293a85c by Inada Naoki in branch
'master':
bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481)
https://github.com/python/cpython/commit/4827483f47906fecee6b5d9097df2a
Change by Inada Naoki :
--
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: Fix EncodingError
versions: Python 3.10
___
Python tracker
<https://bugs.python.org/issue43
Change by Inada Naoki :
--
keywords: +patch
nosy: +methane
nosy_count: 13.0 -> 14.0
pull_requests: +23809
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19481
___
Python tracker
<https://bugs.p
Inada Naoki added the comment:
https://en.wikipedia.org/wiki/Interval_(mathematics)
See "Notations for intervals" section in the Wikipedia page.
--
nosy: +methane
___
Python tracker
<https://bugs.python.o
Inada Naoki added the comment:
New changeset 068ebf9729d440cef03e4c57e3db83c851146172 by Inada Naoki in branch
'master':
bpo-33164: blake2: Fix Coverity scan (GH-25060)
https://github.com/python/cpython/commit/068ebf9729d440cef03e4c57e3db83
Change by Inada Naoki :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Inada Naoki added the comment:
I created bpo-43651 to track fixing EncodingError in Python stdlibs.
I close this issue for now.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracke
Change by Inada Naoki :
--
keywords: +patch
pull_requests: +23841
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25097
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
In bpo-43651, I found code pattern that it's difficult to use
io.text_encoding():
class OpenWrapper:
def __new__(cls, *args, **kwargs):
return open(*args, **kwargs)
`kwargs["encoding"] = text_encoding(kwargs.get("enc
Change by Inada Naoki :
--
superseder: -> PEP 597: Implemente encoding="locale" option and EncodingWarning
___
Python tracker
<https://bugs.pytho
Change by Inada Naoki :
--
pull_requests: +23848
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/25103
___
Python tracker
<https://bugs.python.org/issu
Inada Naoki added the comment:
New changeset ff3c9739bd69aa8b58007e63c9e40e6708b4761e by Inada Naoki in branch
'master':
bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103)
https://github.com/python/cpython/commit/ff3c9739bd69aa8b5800
Change by Inada Naoki :
--
pull_requests: +23851
pull_request: https://github.com/python/cpython/pull/25107
___
Python tracker
<https://bugs.python.org/issue43
Inada Naoki added the comment:
I'm sorry, I was wrong. Allowing `encoding="locale"` didn't help OpenWrapper.
See GH-25107.
If we use `encoding = text_encoding(encoding)` in binary mode, `open(filename,
"rb")` will be warned. This doesn't make sense at a
101 - 200 of 3039 matches
Mail list logo