TypeError: compile() expected string without null bytes

Bug #1005603 reported by Sandro Tosi
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Pyflakes
Fix Released
Low
Florent

Bug Description

Hello,
I'm reporting http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674796:

>>>

If the tested file contains null bytes, pyflakes fails with traceback:

$ pyflakes test.py
Traceback (most recent call last):
  File "/usr/bin/pyflakes", line 5, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/lib/pymodules/python2.7/pyflakes/scripts/pyflakes.py", line 92, in main
    warnings += checkPath(arg)
  File "/usr/lib/pymodules/python2.7/pyflakes/scripts/pyflakes.py", line 74, in checkPath
    return check(fd.read(), filename)
  File "/usr/lib/pymodules/python2.7/pyflakes/scripts/pyflakes.py", line 28, in check
    tree = compile(codeString, filename, "exec", _ast.PyCF_ONLY_AST)
TypeError: compile() expected string without null bytes
<<<

Attached the test file.

Regards,
Sandro

Related branches

Revision history for this message
Sandro Tosi (morph-debian) wrote :
Florent (florent.x)
Changed in pyflakes:
status: New → Confirmed
assignee: nobody → Florent (florent.x)
Florent (florent.x)
Changed in pyflakes:
status: Confirmed → In Progress
Florent (florent.x)
Changed in pyflakes:
status: In Progress → Fix Committed
Florent (florent.x)
Changed in pyflakes:
milestone: none → 0.6.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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