[issue42410] Raise a pickleError when convert _functools module to use PyType_FromModuleAndSpec

2020-11-23 Thread hai shi


hai shi  added the comment:

> It looks like you imported the functools module twice and have two different 
> classes functools.partial. When you try to import one of them, you found the 
> other one.

You are right. Serhiy:)

The key point is `import_helper.import_fresh_module()`.
```
import functools
from test.support import import_helper

partial = functools.partial
new_functools = import_helper.import_fresh_module('functools',
  fresh=['_functools'])
new_partial = new_functools.partial
assert(partial == new_partial)
```
Succeed in master, failed in PR23405.

--

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



[issue42410] Raise a pickleError when convert _functools module to use PyType_FromModuleAndSpec

2020-11-23 Thread hai shi


hai shi  added the comment:

> You should analyze why "cls != obj" conditon is true: why cls is not obj?

You are right. I am in the wrong way definitely. It's weird to me.I try to 
figure it out in this week~

--

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



[issue42418] PyType_GetModule() should warn/fail when type has Py_TPFLAGS_BASETYPE

2020-11-20 Thread hai shi


hai shi  added the comment:

>I propose to either a guard to PyType_GetModule() to prevent misuse of the 
>function or to add a variant of the function that prevents misuse.
+1. Looks like check Py_TPFLAGS_BASETYPE in PyType_GetModule() is an easy way:)

--
nosy: +shihai1991

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



[issue42410] Raise a pickleError when convert _functools module to use PyType_FromModuleAndSpec

2020-11-19 Thread hai shi


Change by hai shi :


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

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



[issue42410] Raise a pickleError when convert _functools module to use PyType_FromModuleAndSpec

2020-11-19 Thread hai shi


hai shi  added the comment:

Oh, sorry, wrong PR number. the right one: PR23405

--

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



[issue42410] Raise a pickleError when convert _functools module to use PyType_FromModuleAndSpec

2020-11-19 Thread hai shi


New submission from hai shi :

Touch an error when convert _functools module to use PyType_FromModuleAndSpec, 
the error info:
_pickle.PicklingError: Can't pickle : it's not the 
same object as functools.partial

The related PR: PR3405

--
components: Extension Modules
messages: 381436
nosy: petr.viktorin, shihai1991, vstinner
priority: normal
severity: normal
status: open
title: Raise a pickleError when convert _functools module to use 
PyType_FromModuleAndSpec
type: behavior
versions: Python 3.10

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



[issue40891] Use PEP 573 in functools

2020-11-19 Thread hai shi


Change by hai shi :


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

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



[issue40891] Use PEP 573 in functools

2020-11-19 Thread hai shi


hai shi  added the comment:

Duplicated issue: bpo-40137, so I closed this one.

--

___
Python tracker 
<https://bugs.python.org/issue40891>
___
___
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

2020-11-19 Thread hai shi


Change by hai shi :


--
pull_requests: +22298
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/23405

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



[issue40600] Add option to disallow > 1 instance of an extension module

2020-11-19 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41861] Convert sqlite3 to heap types (PEP 384)

2020-11-17 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-15 Thread hai shi


Change by hai shi :


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

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-15 Thread hai shi


hai shi  added the comment:

Hi, petr. If there is no other doubt about this bpo, I suggest close this bpo.

--

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



[issue42333] Port ssl module to heap types and module state (PEP 573)

2020-11-12 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-11 Thread hai shi


Change by hai shi :


--
pull_requests: +22140
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/23243

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-11 Thread hai shi


hai shi  added the comment:

> The PR entirely removed the note that a slot's value "May not be NULL".
> In fact, only tp_doc may be NULL. AFAIK, the restriction is still there > for 
> other slots.
> Can that note be added back?

`May not be NULL` means everthing is possible, so I decided removed it:(
Before, I updated an old commit in PR23123 to describe this fact in 
https://github.com/python/cpython/pull/23123/commits/cca7bc7edf11a7d212ae70dcff6f10cf96fab470.

--

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2020-11-10 Thread hai shi


Change by hai shi :


--
pull_requests: +22132
pull_request: https://github.com/python/cpython/pull/23235

___
Python tracker 
<https://bugs.python.org/issue40170>
___
___
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

2020-11-10 Thread hai shi


Change by hai shi :


--
versions: +Python 3.10 -Python 3.9

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



[issue42294] [C API] Add new C functions with more regular reference counting like PyTuple_GetItemRef()

2020-11-09 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-11-07 Thread hai shi


hai shi  added the comment:

> Do you mean something like "only expose a slot if you have a reason for > 
> exposing it"? That sounds like a tautology.
> Where in the docs would this go?

Add a friend Note in docs of `PyType_GetSlot` MAYBE?

> You mean nb_reserved, right?
Yes, thanks for your description.

--

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



[issue42258] argparse: show choices once per argument

2020-11-07 Thread hai shi


New submission from hai shi :

I like your improvement.
But I suggest you should copy your first comment from your PR to here.(It's 
easy for discuss in here;)

--
nosy: +paul.j3, rhettinger, shihai1991

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-06 Thread hai shi


hai shi  added the comment:

Thank you all:)

--

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



[issue42260] [C API] Add PyInterpreterState_SetConfig(): reconfigure an interpreter

2020-11-05 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-04 Thread hai shi


hai shi  added the comment:

> If you change this, why do it only for tp_doc, but for all the slots? NULL 
> should *always* mean that the slot is set to NULL instead of inherited. 
> (Except maybe in cases where this is dangerous; then it should result in an 
> error?

IMO, it's a proper user case.
>From bpo-26978: "I'll also try making an explicit `{Py_tp_dealloc, NULL}` 
>override the inherited value, as per Serhiy's suggestion."
Petr, do you have a PR about it?

> If you want to only change this for tp_doc, please also update the 
> PyType_Slot documentation to cover the exception.

Copy that, I will update it soon.

--

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



[issue42035] [C API] PyType_GetSlot cannot get tp_name

2020-11-03 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-03 Thread hai shi


Change by hai shi :


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

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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-11-02 Thread hai shi


Change by hai shi :


--
versions: +Python 3.10 -Python 3.9

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-02 Thread hai shi


hai shi  added the comment:

I will take a look in this weekend :)

--

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



[issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores.

2020-11-01 Thread hai shi


Change by hai shi :


--
pull_requests: +22010
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/23096

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



[issue42100] Add _PyType_GetModuleByDef

2020-10-30 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41626] port shebang of tools from python2 to python3

2020-10-30 Thread hai shi


hai shi  added the comment:

typo error: PR21913->PR21931

--

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



[issue41626] port shebang of tools from python2 to python3

2020-10-30 Thread hai shi

hai shi  added the comment:

Sorry for my delay~

>I think some of these work with any Python, but some need the locally built 
>interpreter to give correct results.
>It could avoid confusion and mistakes to remove the shebangs and executable 
>bits from the scripts that need a local Python, and make dure their 
>documentation mentions `./python path/to/tool`.

I update Objects/typeslots.py in #PR21913 recently and using f-format in this 
script(it means that just local python or python3 can run). So I will accept 
your suggestion from this file after this PR merged:)

>(Oh and by the way, Tools/scripts/fixps.py is a tool to replace 
>`/usr/local/bin/python` shebangs with `/usr/bin/env python`…  You can judge if 
>that is useful and/or correct.)

Thanks, I will take a look.

> So if things are changed (let’s get a couple opinions here), maybe this needs 
> separate PRs for 1/2/3, and make sure to get reviews to ensure we don’t break 
> IDLE / Mac installers / pegen / etc.

Agree. To corner case, a single sepereate PR is good.

--

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



[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-10-30 Thread hai shi


hai shi  added the comment:

> IMO, a slot should be exposed if there is some reason for exposing it.

Can we write those info to docs? In case some developer want to exposing slot 
in future.

> Which other slots are we missing?

nb_inserved in PyNumberMethods should be removed?

--

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



[issue42111] Make the xxlimited module an example of best extension module practices

2020-10-29 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue42171] Add PEP 573 to the stable ABI

2020-10-29 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41796] _ast module state should be made per interpreter

2020-10-29 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue38865] [subinterpreters] Can Py_Finalize() be called if the current interpreter is not the main interpreter?

2020-10-26 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue42145] test_io is leaking references

2020-10-25 Thread hai shi


hai shi  added the comment:

I created a possible fix PR: PR-22973

--

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



[issue41919] Modify test_codecs to use the new codecs.unregister() function

2020-10-25 Thread hai shi


hai shi  added the comment:

> AS this is masking other issues in the build bots, we need to revert the 
> commit unless is fixed in 24 hours per the buildbot workflow

Thanks, Pablo. I checked that only test_io.py have resource leak.
I create PR-22973, pls take a look if you have free time, thanks.

--

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



[issue41919] Modify test_codecs to use the new codecs.unregister() function

2020-10-25 Thread hai shi


Change by hai shi :


--
pull_requests: +21888
pull_request: https://github.com/python/cpython/pull/22973

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



[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-10-20 Thread hai shi


hai shi  added the comment:

Thanks petr for your review and merge.

--

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



[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-10-20 Thread hai shi


hai shi  added the comment:

> Definitely. Sorry for the delay -- I missed the notification here.
No problem. This is not a block issue :)

--

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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-10-14 Thread hai shi


hai shi  added the comment:

Thanks for everyone's continus review :)

--

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



[issue41919] Move the codecs.register operation to testcases

2020-10-03 Thread hai shi


Change by hai shi :


--
title: Move the codecs' register operation to testcases -> Move the 
codecs.register operation to testcases

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



[issue41919] Move the codecs' register operation to testcases

2020-10-03 Thread hai shi


Change by hai shi :


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

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



[issue41919] Move the codecs' register operation to testcases

2020-10-03 Thread hai shi


New submission from hai shi :

After PR22360 merged, we can move the codecs' register operation to testcases.

--
components: Tests
messages: 377863
nosy: shihai1991, vstinner
priority: normal
severity: normal
status: open
title: Move the codecs' register operation to testcases
type: enhancement
versions: Python 3.10

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



[issue40455] GCC 10 compiler warnings

2020-10-02 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41902] Micro optimization for range.index if step is 1

2020-10-02 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread hai shi


hai shi  added the comment:

oh, sorry, typo error. multiple search functions-->multiple error handler.

--

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



[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread hai shi


hai shi  added the comment:

> If add a function for unregistering a codec search function, it would be 
> worth to add also a function for unregistering an error handler.

Registering an error handler have no refleaks when registering multiple search 
functions.
+1 if end user need this function.

--

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



[issue41871] Add PyList_Remove() in listobject.c

2020-09-27 Thread hai shi


hai shi  added the comment:

> You always can use PyObject_CallMethod(). It is not a method called in tight 
> loop for which the overhead of calling method is significant.
Thanks, serhiy. You are right.
To PR19069, it's fine to use `PyList_SetSlice` or `PyObject_CallMethod`.
We don't have the enough reason to add `PyList_Remove()`,so I decided close 
this bpo now.

PS: I attach a PR which have add `PyList_Remove` in here in case we will meet 
another appropriate user case somedays: 
https://github.com/python/cpython/compare/master...shihai1991:add_PyList_Remove?expand=1

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

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



[issue41871] Add PyList_Remove() in listobject.c

2020-09-27 Thread hai shi


New submission from hai shi :

Do we need add PyList_Remove() in C level? same thing like list.remove().
As victor comment in: 
https://github.com/python/cpython/pull/19069#discussion_r491893466.

--
components: C API
messages: 377566
nosy: shihai1991, vstinner
priority: normal
severity: normal
status: open
title: Add PyList_Remove() in listobject.c
versions: Python 3.10

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



[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread hai shi


Change by hai shi :


--
keywords: +patch
nosy: +shihai1991
nosy_count: 3.0 -> 4.0
pull_requests: +21424
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22360

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



[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-09-22 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-09-22 Thread hai shi


Change by hai shi :


--
pull_requests: +21401
pull_request: https://github.com/python/cpython/pull/22360

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



[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-09-19 Thread hai shi


hai shi  added the comment:

Hi, petr. Can you help me merge this PR to 3.9 too?

--

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



[issue41797] PyModule_GetState doesn't work with LazyLoader

2020-09-17 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API

2020-09-17 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue40288] [subinterpreters] atexit module should not be loaded more than once per interpreter

2020-09-15 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue39337] codecs.lookup() ignores non-ASCII characters, whereas encodings.normalize_encoding() copies them

2020-09-12 Thread hai shi


Change by hai shi :


--
pull_requests: +21274
pull_request: https://github.com/python/cpython/pull/22219

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



[issue41736] test_site: test_s_option() failed on AMD64 Windows8.1 Refleaks 3.7

2020-09-08 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41739] test_logging: threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)

2020-09-07 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-09-05 Thread hai shi


Change by hai shi :


--
title: Update the refcounts.dat of `PyType_FromModuleAndSpec` -> Update 
refcounts info of PyType_FromModuleAndSpec in refcounts.dat

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



[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-09-05 Thread hai shi


Change by hai shi :


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

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



[issue41726] Update the refcounts.dat of `PyType_FromModuleAndSpec`

2020-09-05 Thread hai shi


New submission from hai shi :

`PyType_FromModuleAndSpec` in docs doesn't show the info:`Return value: New 
reference.`

--
assignee: docs@python
components: Documentation
messages: 376432
nosy: docs@python, petr.viktorin, shihai1991
priority: normal
severity: normal
status: open
title: Update the refcounts.dat of `PyType_FromModuleAndSpec`
versions: Python 3.10, Python 3.9

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



[issue41692] Deprecate immortal interned strings: PyUnicode_InternImmortal()

2020-09-05 Thread hai shi


hai shi  added the comment:

+1

--

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



[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2020-09-04 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41692] Deprecate immortal interned strings: PyUnicode_InternImmortal()

2020-09-02 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41654] Segfault when raising MemoryError

2020-08-30 Thread hai shi


hai shi  added the comment:

Hm, Looks like we need check the double free risk of `Py_DECREF()`.

--

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



[issue41654] Segfault when raising MemoryError

2020-08-28 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41625] Add splice() to the os module

2020-08-25 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-25 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue41626] port shebang of tools from python2 to python3

2020-08-24 Thread hai shi


Change by hai shi :


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

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



[issue41626] port shebang of tools from python2 to python3

2020-08-24 Thread hai shi


New submission from hai shi :

After the EOL of python2, the shebang of tools should be ported from python2 to 
python3.

some files like: 
https://github.com/python/cpython/blob/master/Objects/typeslots.py#L1

--
messages: 375855
nosy: shihai1991
priority: normal
severity: normal
status: open
title: port shebang of tools from python2 to python3
versions: Python 3.10

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



[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-08-23 Thread hai shi


hai shi  added the comment:

related bpo: bpo-41073

--

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



[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-08-23 Thread hai shi


New submission from hai shi :

In order to resolve bpo41073, we want to extend `PyType_GetSlot()` to accept 
static types. But there have another question we should be considered: How many 
slots should be exposed in `PyType_GetSlot()`.

petr's opinion from PR-21931:I would not want to expose the Py_tp_as_* slots at 
all; their contents are covered in other slots that should be used instead. And 
slots like Py_tp_version_tag are specific to CPython; I don't think they should 
be exposed in the general C API.

--
components: C API
messages: 375808
nosy: petr.viktorin, shihai1991, vstinner
priority: normal
severity: normal
status: open
title: [C API] How many slots of static types should be exposed in 
PyType_GetSlot()
type: enhancement
versions: Python 3.10

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



[issue41073] [C API] PyType_GetSlot() should accept static types

2020-08-20 Thread hai shi


Change by hai shi :


--
pull_requests: +21044
pull_request: https://github.com/python/cpython/pull/21931

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-08-17 Thread hai shi


Change by hai shi :


--
pull_requests: +21022
pull_request: https://github.com/python/cpython/pull/21902

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



[issue41551] test.support has way too many imports in libregrtest

2020-08-16 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-08-15 Thread hai shi


Change by hai shi :


--
pull_requests: +21015
pull_request: https://github.com/python/cpython/pull/21896

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



[issue40275] test.support has way too many imports

2020-08-13 Thread hai shi


hai shi  added the comment:

oh, sorry, missing a word: I suggest this bpo.->I suggest close this bpo.

--

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



[issue40275] test.support has way too many imports

2020-08-13 Thread hai shi


hai shi  added the comment:

If someone wants to continue the effort in libregrtest, I suggest to open a new 
issue.
+1. And if there have any other test cases blocked by test.support, I suggest 
this bpo.

--

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-08-12 Thread hai shi


hai shi  added the comment:

> Py_Finalize() calls _PyUnicode_ClearInterned() which clears interned strings. 
> Which strings are still alive after Py_Finalize()?

Yes.especially those encodings, interpreter leaks much encodings refcount after 
Py_Finalize(). I am not sure they are corner cases or not.
Maybe we could check it again afer we have done all convert works.

No matter how many times `Py_Initialize(); Py_Finalize();` have called, Holding 
a same interned of unicodeobject.c all the time sound like a stupied idea.

--

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



[issue41534] argparse : allow_abbrev behavior between 3.7 and 3.8

2020-08-12 Thread hai shi


Change by hai shi :


--
nosy: +paul.j3, rhettinger

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-08-12 Thread hai shi


hai shi  added the comment:

There will have many unicode strs releaks when we calling `Py_Initialize()` 
again after `Py_Finalize()`: interned will be cleared in `Py_Finalize()`, but 
those unicodes str will still alive all the time.

Q: How to solve the probleam?
A: MAYBE we need share the interned of unicodeobject.c all the time and don't 
care how many times we will calling `Py_Initialize(); Py_Finalize();`

--

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



[issue40275] test.support has way too many imports

2020-08-12 Thread hai shi


hai shi  added the comment:

Hi, victor:
  About https://bugs.python.org/issue40275#msg369214, shall we continue to 
improve the libregretest?
1. Running test cases sequential: you have use a mechanism to unload the 
modules which load in the running test cases stage: 
https://github.com/python/cpython/blob/master/Lib/test/libregrtest/main.py#L437
2. Running test cases concurrently: It have use subprocess to isolate the 
module resources, no?
I am not sure about it.

--

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



[issue40949] test_socket altered the execution environment: threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 5)

2020-08-12 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

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



[issue40275] test.support has way too many imports

2020-08-10 Thread hai shi


Change by hai shi :


--
pull_requests: +20944
pull_request: https://github.com/python/cpython/pull/21811

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



[issue40275] test.support has way too many imports

2020-08-10 Thread hai shi


hai shi  added the comment:

> Hai Shi: Would you mind to investigate this issue?
Oh, sure, I will check the test cases again.

--

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



[issue40275] test.support has way too many imports

2020-08-09 Thread hai shi


hai shi  added the comment:

# Confusing, especially now that PR #s are catching up to issue #s.
Maybe we need redefine the matching rule(I am not sure about it).

--
versions: +Python 3.10 -Python 3.9

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



[issue40275] test.support has way too many imports

2020-08-08 Thread hai shi


hai shi  added the comment:

Hi, terry. When creating the new test helpers, the docs have been updated.
such as: 
https://docs.python.org/3.10/library/test.html#module-test.support.os_helper

--

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



[issue40275] test.support has way too many imports

2020-08-08 Thread hai shi


Change by hai shi :


--
pull_requests: +20927
pull_request: https://github.com/python/cpython/pull/21785

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



[issue40275] test.support has way too many imports

2020-08-07 Thread hai shi


Change by hai shi :


--
pull_requests: +20922
pull_request: https://github.com/python/cpython/pull/21771

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



[issue40275] test.support has way too many imports

2020-08-07 Thread hai shi


Change by hai shi :


--
pull_requests: +20917
pull_request: https://github.com/python/cpython/pull/21772

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



[issue40275] test.support has way too many imports

2020-08-07 Thread hai shi


Change by hai shi :


--
pull_requests: +20908
pull_request: https://github.com/python/cpython/pull/21764

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



[issue40275] test.support has way too many imports

2020-08-06 Thread hai shi


Change by hai shi :


--
pull_requests: +20895
pull_request: https://github.com/python/cpython/pull/21743

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



[issue40275] test.support has way too many imports

2020-08-03 Thread hai shi


Change by hai shi :


--
pull_requests: +20870
pull_request: https://github.com/python/cpython/pull/21727

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



[issue41394] Document '_' in interpreter in shell tutorial

2020-07-26 Thread hai shi


hai shi  added the comment:

>I haven't checked to see what's documented. I'm sure we'd accept a patch that 
>improves the documentation if it's lacking.
+1

--
nosy: +shihai1991

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



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-24 Thread hai shi


hai shi  added the comment:

What's change for the performance benchmark?

--
nosy: +shihai1991

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-07-24 Thread hai shi


Change by hai shi :


--
pull_requests: +20746
pull_request: https://github.com/python/cpython/pull/21605

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



  1   2   3   4   5   6   >