New submission from Xiang Zhang:

When any exception is raised inside __fspath__, operations involving it like 
os.fspath, open are certain to crash.

>>> import os
>>> class Test:
...     def __fspath__(self):
...             raise RuntimeError
... 
>>> os.fspath(Test())
Segmentation fault (core dumped)

Attach a patch to fix this.

----------
components: Extension Modules
files: fix_fspath_crash.patch
keywords: patch
messages: 270386
nosy: brett.cannon, ethan.furman, xiang.zhang
priority: normal
severity: normal
status: open
title: os.fspath is certain to crash when exception raised in __fspath__
type: crash
versions: Python 3.6
Added file: http://bugs.python.org/file43713/fix_fspath_crash.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27512>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to