This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SystemError on invalid numpy.ndarray / Path operation
Type: Stage:
Components: Interpreter Core Versions: Python 3.5
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Antony.Lee, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2016-02-28 07:16 by Antony.Lee, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg260967 - (view) Author: Antony Lee (Antony.Lee) * Date: 2016-02-28 07:16
Running
```
from pathlib import Path
import numpy as np
np.arange(300000) / Path("foo")
```
raises
```
TypeError: argument should be a path or str object, not <class 'int'>

During handling of the above exception, another exception occurred:

SystemError: <built-in method __new__ of type object at 0x7fb4df227fc0> returned a result with an error set

<elided: many repeats of the same>

During handling of the above exception, another exception occurred:

SystemError: <built-in method __new__ of type object at 0x7fb4df227fc0> returned a result with an error set

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/foo.py", line 3, in <module>
    np.arange(300000) / Path("foo")
  File "/usr/lib/python3.5/pathlib.py", line 879, in __rtruediv__
    return self._from_parts([key] + self._parts)
  File "/usr/lib/python3.5/pathlib.py", line 637, in _from_parts
    self = object.__new__(cls)
SystemError: <built-in method __new__ of type object at 0x7fb4df227fc0> returned a result with an error set
```
Note that this does NOT appear for small arrays; I haven't determined the threshold.
Crossposted as https://github.com/numpy/numpy/issues/7360.
msg260973 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-02-28 12:39
This looks as NumPy bug.
msg260975 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-02-28 13:06
Bug in NumPy.
History
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70640
2016-02-28 13:06:30vstinnersetstatus: open -> closed

messages: + msg260975
2016-02-28 12:39:36serhiy.storchakasetnosy: + serhiy.storchaka, vstinner
resolution: third party
messages: + msg260973
2016-02-28 07:16:59Antony.Leecreate