[issue45127] Code objects can contain unmarshallable objects

Petr Viktorin report at bugs.python.org
Tue Sep 7 10:01:23 EDT 2021


Petr Viktorin <encukou at gmail.com> added the comment:

How to fix this? I guess:

* co_filename should be converted to an actual str, or reject subclasses with an exception
* for co_consts, the [marshal docs] could be updated to add code objects to "containers". The [code docs] already say co_consts "is a tuple containing the literals"; if someone's putting in non-literals they're voiding the warranty.

And so on for all other fields of code objects.

[marshal docs]: https://docs.python.org/3/library/marshal.html
[code docs]: https://docs.python.org/3.9/reference/datamodel.html#index-55

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45127>
_______________________________________


More information about the Python-bugs-list mailing list