3.2.3-3 regression: copy_scripts crashes with UnicodeDecodeError

Bug #1026016 reported by Martin Pitt on 2012-07-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3.2 (Ubuntu)
High
Unassigned

Bug Description

Until yesterday, ubuntu-drivers-common built just fine. With today's python3.2 update, it now fails to build with:

running build_scripts
creating build/scripts-3.2
copying and adjusting nvidia-detector -> build/scripts-3.2
copying and adjusting quirks-handler -> build/scripts-3.2
copying and adjusting ubuntu-drivers -> build/scripts-3.2
Traceback (most recent call last):
  File "/usr/lib/python3.2/tokenize.py", line 298, in find_cookie
    line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 32: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 40, in <module>
    """,
  File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.2/distutils/command/build.py", line 126, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.2/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.2/distutils/command/build_scripts.py", line 50, in run
    self.copy_scripts()
  File "/usr/lib/python3.2/distutils/command/build_scripts.py", line 82, in copy_scripts
    encoding, lines = tokenize.detect_encoding(f.readline)
  File "/usr/lib/python3.2/tokenize.py", line 327, in detect_encoding
    encoding = find_cookie(first)
  File "/usr/lib/python3.2/tokenize.py", line 300, in find_cookie
    raise SyntaxError("invalid or missing encoding declaration")
SyntaxError: invalid or missing encoding declaration
make[1]: *** [override_dh_auto_build] Error 1

After adding a print() to /usr/lib/python3.2/distutils/command/build_scripts.py I found out that it fails on copying share/hybrid/hybrid-detect which is a binary ELF file.

Why does copy_scripts() even bother with detecting the encoding of the file? It's supposed to just copy the program as it is.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: python3.2 3.2.3-3
ProcVersionSignature: Ubuntu 3.5.0-4.4-generic 3.5.0-rc6
Uname: Linux 3.5.0-4-generic x86_64
ApportVersion: 2.3-0ubuntu4
Architecture: amd64
Date: Wed Jul 18 10:01:32 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120627)
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: python3.2
UpgradeStatus: No upgrade log present (probably fresh install)

Martin Pitt (pitti) wrote :
Changed in python3.2 (Ubuntu):
importance: Undecided → High
Matthias Klose (doko) wrote :

- well, it's called copy_scripts, not copy_binaries ;) maybe you can work around this by building/installing a data file.
- distutils is frozen, and doesn't see any new changes.

therefore closing as won't fix

Changed in python3.2 (Ubuntu):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers