pyflakes crashed with TypeError in check(): compile() expected string without null bytes

Bug #1104455 reported by Anders Kaseorg
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pyflakes
Invalid
Undecided
Unassigned
pyflakes (Ubuntu)
New
Medium
Unassigned

Bug Description

Passing a file including null bytes crashes pyflakes:

$ printf '\0' | pyflakes
Traceback (most recent call last):
  File "/usr/bin/pyflakes", line 5, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/pyflakes/scripts/pyflakes.py", line 94, in main
    warnings += check(sys.stdin.read(), '<stdin>')
  File "/usr/lib/python2.7/dist-packages/pyflakes/scripts/pyflakes.py", line 28, in check
    tree = compile(codeString, filename, "exec", _ast.PyCF_ONLY_AST)
TypeError: compile() expected string without null bytes

ProblemType: Crash
DistroRelease: Ubuntu 13.04
Package: pyflakes 0.5.0-2ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-1.5-generic 3.8.0-rc4
Uname: Linux 3.8.0-1-generic x86_64
NonfreeKernelModules: openafs
ApportVersion: 2.8-0ubuntu2
Architecture: amd64
Date: Thu Jan 24 16:11:36 2013
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/pyflakes
InstallationDate: Installed on 2010-12-05 (781 days ago)
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20101202)
InterpreterPath: /usr/bin/python2.7
MarkForUpload: True
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/pyflakes
PythonArgs: ['/usr/bin/pyflakes']
SourcePackage: pyflakes
Title: pyflakes crashed with TypeError in check(): compile() expected string without null bytes
UpgradeStatus: Upgraded to raring on 2012-11-15 (70 days ago)
UserGroups: adm admin cdrom dialout fuse libvirtd lpadmin plugdev sambashare sudo wireshark

Revision history for this message
Anders Kaseorg (andersk) wrote :
information type: Private → Public
tags: removed: need-duplicate-check
Changed in pyflakes (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Florent (florent.x) wrote :

It seems it is no longer an issue with Pyflakes 0.7.3

$ pyflakes --version
0.7.3
$ printf '\0' | pyflakes
<stdin>: problem decoding source

Changed in pyflakes:
milestone: none → 0.7.3
status: New → Invalid
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.