[issue31798] "abs__file__" in "Lib/site.py" fails for modules where "__file__" cannot be assigned a new value

Alexander McFarlane report at bugs.python.org
Mon Oct 16 07:00:16 EDT 2017


New submission from Alexander McFarlane <alex.mcfarlane.uk at gmail.com>:

The pythonnet module clr causes a TypeError when `abs__file__` attempts to run the following line:

`m.__file__ = os.path.abspath(m.__file__)`

Reproduction:

```
import clr
cls.__file__ = 'example'
```

----------
components: +Library (Lib)
title: abs__file__ in "Lib/site.py" -> "abs__file__" in "Lib/site.py" fails for modules where "__file__" cannot be assigned a new value
versions: +Python 2.7

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


More information about the Python-bugs-list mailing list