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