Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
malloc: *** error in re for Python 3.5
import re
def fn():
scanner = re.Scanner([
(r'([0-9]{2}):([0-9]{2}):([0-9]{2})', lambda y, x: x),
(r'.', lambda y, x: x)
])
return scanner.scan("10:10:10")
# This works on Python 2.7, but not on Python 3.5
for i in range(10):
print(fn())
# Error: Python(87764,0x7fff72029000) malloc: *** error for object 0x10331d4e8: incorrect checksum for freed object - object was probably modified after being freed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment