This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients alexandre.vassalotti, belopolsky, lemburg, pitrou
Date 2010-06-28.11:30:29
SpamBayes Score 7.02093e-07
Marked as misclassified No
Message-id <4C2887D3.3090401@egenix.com>
In-reply-to <1277602289.41.0.933413768888.issue5180@psf.upfronthosting.co.za>
Content
Alexander Belopolsky wrote:
> 
> Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment:
> 
> The bytes/string issu was a red herring: with pickle.load(open('27.bench', 'b')), I get the same stack trace as from command line pybench invocation.
> 
> 
>>>> pickle.load(open('27.bench', 'rb'))
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/Users/sasha/Work/python-svn/py3k-commit/Lib/pickle.py", line 1321, in load
>     encoding=encoding, errors=errors).load()
>   File "/Users/sasha/Work/python-svn/py3k-commit/Lib/pickle.py", line 830, in load
>     dispatch[key[0]](self)
>   File "/Users/sasha/Work/python-svn/py3k-commit/Lib/pickle.py", line 1055, in load_inst
>     klass = self.find_class(module, name)
>   File "/Users/sasha/Work/python-svn/py3k-commit/Lib/pickle.py", line 1115, in find_class
>     __import__(module, level=0)
>   File "/Users/sasha/Work/python-svn/py3k-commit/Tools/pybench/Unicode.py", line 17
>     s = unicode(u''.join(map(str,range(100))))
>                   ^
> SyntaxError: invalid syntax

Note that pybench is written in a way that it can handle ImportErrors
and SyntaxErrors gracefully. This is per design, since test modules can
well be written for more recent Python versions that support a certain
features or syntax not present in earlier versions.

In the above case, it may be a good idea to redirect pickle to
the new Strings3 module (see my other message). Likewise, the
Strings test module should redirect to the new Bytes test module
in Python3.

The Unicode and Strings modules should not be loaded in Python3.
Instead, the Bytes and Strings3 modules should be used. This can
be changed in Setup.py of pybench.
History
Date User Action Args
2010-06-28 11:30:32lemburgsetrecipients: + lemburg, belopolsky, pitrou, alexandre.vassalotti
2010-06-28 11:30:30lemburglinkissue5180 messages
2010-06-28 11:30:29lemburgcreate