[New-bugs-announce] [issue39517] runpy calls open_code with Path object

Tomas Ravinskas report at bugs.python.org
Sat Feb 1 12:02:12 EST 2020


New submission from Tomas Ravinskas <tomas.rav at gmail.com>:

runpy accepts Path like objects but open_code seems to only accept strings, so calling open_code with Path object throws TypeError.
I think runpy should call str() on all path passed to open_code.
The relevant line is 232 in runpy.py in function _get_code_from_file.

----------
components: Library (Lib)
messages: 361176
nosy: Tomas Ravinskas
priority: normal
severity: normal
status: open
title: runpy calls open_code with Path object
type: crash
versions: Python 3.8

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


More information about the New-bugs-announce mailing list