[New-bugs-announce] [issue36792] zipfile.writestr causes a Python crash on Windows if the locale is set

Charlie Clark report at bugs.python.org
Sat May 4 08:33:18 EDT 2019


New submission from Charlie Clark <charlie.clark at clark-consulting.eu>:

Based on a bug report (https://bitbucket.org/openpyxl/openpyxl/issues/1266/locale) from a user of the openpyxl library I've identified a bug in the zipfile module that causes the Python process to crash on Windows. Currently tested with Python 3.7.3 (32-bit on Windows 10).

Sample code

import faulthandler
import locale
from zipfile import ZipFile

faulthandler.enable()

locale.setlocale(locale.LC_ALL, 'de_DE')
out = open("out.zip", "wb") 
archive = ZipFile(out, "w")
archive.writestr("properties.xml", b"<workbookPr/>")

faulthandler fingers line 1757 as the culprit but running this line locally does not cause the crash. The issue seems to be limited to Windows.

----------
components: Interpreter Core, Windows
messages: 341380
nosy: CharlieClark, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: zipfile.writestr causes a Python crash on Windows if the locale is set
versions: Python 3.7

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


More information about the New-bugs-announce mailing list