This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients christian.heimes, erlendaasland, pablogsal, serhiy.storchaka, shreyanavigyan, vstinner
Date 2021-04-30.22:40:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619822443.89.0.421303316022.issue43916@roundup.psfhosted.org>
In-reply-to
Content
Status in Python 3.9.

5 types allow instantiation whereas they must not: BUG!!!

* _tkinter.Tcl_Obj
* _tkinter.tkapp
* _tkinter.tktimertoken
* zlib.Compress
* zlib.Decompress

Example of bug:

$ python3.9
Python 3.9.4
>>> import zlib
>>> obj=zlib.compressobj()
>>> obj2=type(obj)()
>>> obj2.copy()
Erreur de segmentation (core dumped)

---

The remaining types disallow instantiation with different ways.

Static type with tp_base=NULL and tp_new=NULL:

* _dbm.dbm
* _gdbm.gdbm
* _multibytecodec.MultibyteCodec
* _sre.SRE_Scanner
* _thread._localdummy
* _thread.lock
* _winapi.Overlapped
* _xxsubinterpretersmodule.ChannelID
* array.arrayiterator
* functools.KeyWrapper
* functools._lru_list_elem
* pyexpat.xmlparser
* re.Match
* re.Pattern
* unicodedata.UCD
* _xxsubinterpreters.ChannelID

Heap type setting tp_new to NULL after type creation:

* _curses_panel.panel

Static type setting tp_new to NULL after type creation:

* _curses.ncurses_version type
* sys.flags type
* sys.getwindowsversion() type
* sys.version_info type

Define a tp_new or tp_init function which always raise an exception:

* PyStdPrinter_Type
* _hashlib.HASH
* _hashlib.HASHXOF
* _hashlib.HMAC
* os.DirEntry
* os.ScandirIterator
* select.poll
History
Date User Action Args
2021-04-30 22:40:43vstinnersetrecipients: + vstinner, christian.heimes, serhiy.storchaka, pablogsal, erlendaasland, shreyanavigyan
2021-04-30 22:40:43vstinnersetmessageid: <1619822443.89.0.421303316022.issue43916@roundup.psfhosted.org>
2021-04-30 22:40:43vstinnerlinkissue43916 messages
2021-04-30 22:40:43vstinnercreate