[New-bugs-announce] [issue19447] py_compile.compile raises if a file has bad encoding

Bohuslav "Slavek" Kabrda report at bugs.python.org
Wed Oct 30 10:42:07 CET 2013


New submission from Bohuslav "Slavek" Kabrda:

If py_compile.compile is used on a file with bad encoding (e.g. Lib/test/bad_coding2.py), the function raises even if doraise=False is passed. I'm attaching a patch that fixes this in 3.3 - I haven't tried on 3.4 yet and the code has changed, so I'm not sure it's problem there.

(Background: During RPM build of Python 3 in Fedora, we use py_compile.compile to make sure all files are properly compiled and have newer timestamps. We use 'find' to get all *.py files under 'python3.3/' and then xargs to pass the files to Python script that compiles them. If one of the files causes py_compile.compile to raise, the rest doesn't get compiled.)

----------
components: Build
files: 00186-dont-raise-from-py_compile.patch
keywords: patch
messages: 201721
nosy: bkabrda
priority: normal
severity: normal
status: open
title: py_compile.compile raises if a file has bad encoding
versions: Python 3.3
Added file: http://bugs.python.org/file32422/00186-dont-raise-from-py_compile.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19447>
_______________________________________


More information about the New-bugs-announce mailing list