[pypy-issue] [issue1667] py3k: invalid encoding validation

ita tracker at bugs.pypy.org
Fri Jan 3 18:18:15 CET 2014

New submission from ita <tnagy1024 at gmail.com>:

Consider the following file, containing a null byte on a *commented* line:

$ echo -e "#\!/usr/bin/env python\n# encoding: ISO8859-1\nprint('ok')\n#\x00" > x.py

It works in cpython 2 and 3 (and in jython and in ironpython)
$ python2 x.py
young at yang:~$ python3 x.py 

It also works in pypy 2 as expected:
$ ~/Downloads/pypy-2.2.1-linux64/bin/pypy x.py 

But pypy3 refuses to run it:

$ ~/pypy3-2.1-beta1-linux64/bin/pypy x.py 
TypeError: argument must be a string without NUL characters

messages: 6452
nosy: ita, pypy-issue
priority: bug
status: unread
title: py3k: invalid encoding validation

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list