Message324300
I was working on a library called rows[https://github.com/turicas/rows] when a segmentation fault was thrown in the moment I've tried to read a CSV file. Since this part of the code is implemented completely in Python, I thought it could be a bug in Python itself.
Investigating the code I found it was faulting at exec()'s line inside namedtuple code (Lib/collections/__init__.py). After some time testing, I've came up with this piece of code to reproduce it:
```
try:
float('áxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
except:
from collections import namedtuple
namedtuple('T', 'f')
```
The code works if I:
- Run passing `PYTHONMALLOC=debug`
- Place 'from collections import namedtuple' into the first line
- Remove any char from the string in the 'float(...)' line
- Remove the 'á' from the string in the 'float(...)' line
I've tested the code on Python 3.6.6, 3.7.0, 3.7-dev and 3.8-dev (versions installed using pyenv on a Debian GNU/Linux machine) and the problem happened only in 3.7.0.
This issue seems to be related to https://bugs.python.org/issue34087 but I preferred to create a new one since I don't know if there are automated tests for this specific case. |
|
Date |
User |
Action |
Args |
2018-08-29 04:20:50 | turicas | set | recipients:
+ turicas |
2018-08-29 04:20:50 | turicas | set | messageid: <1535516450.51.0.56676864532.issue34539@psf.upfronthosting.co.za> |
2018-08-29 04:20:50 | turicas | link | issue34539 messages |
2018-08-29 04:20:49 | turicas | create | |
|