py3compile fails on error output

Bug #734957 reported by Julian Taylor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3-defaults (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

line 331 of py3compile fails when there is output from the child process as sys.stderr.write expects a string, but process.communicate returns a byte array:

328 (child_output, child_unused) = process.communicate()
329 if process.returncode not in (None, 0):
330 # FIXME: find out the package the file belongs to
331 sys.stderr.write(child_output)
332 rv = process.returncode

this aborts py3compile on stderr output.
example is in bug 730144 where an invalid syntax causes stderr output:

Setting up python3-cxx (6.2.0-4build1) ...
Traceback (most recent call last):
  File "/usr/bin/py3compile", line 336, in <module>
    main()
  File "/usr/bin/py3compile", line 331, in main
    sys.stderr.write(child_output)
TypeError: must be str, not bytes

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: python3 3.2~rc1-2
ProcVersionSignature: Ubuntu 2.6.38-6.34-generic 2.6.38-rc7
Uname: Linux 2.6.38-6-generic x86_64
Architecture: amd64
Date: Mon Mar 14 17:59:34 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20110301.6)
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: python3-defaults
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Julian Taylor (jtaylor) wrote :
Julian Taylor (jtaylor)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python3-defaults - 3.2~rc1-2ubuntu1

---------------
python3-defaults (3.2~rc1-2ubuntu1) natty; urgency=low

  [ Piotr Ożarowski ]
  * py3compile: let py_compile.py warn about syntax errors again

  [ Scott Kitterman ]
  * Cherry pick fix from Debian bzr (LP: #734957)
 -- Scott Kitterman <email address hidden> Mon, 14 Mar 2011 13:38:41 -0400

Changed in python3-defaults (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.