[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] python tests: Do not require .pyo files

From: Lukas Fleischer
Subject: Re: [PATCH 2/2] python tests: Do not require .pyo files
Date: Mon, 09 Jul 2018 16:59:36 +0200
User-agent: alot/0.7

On Sun, 08 Jul 2018 at 23:29:47, Mathieu Lirzin wrote:
> Mathieu Lirzin <address@hidden> writes:
> > Lukas Fleischer <address@hidden> writes:
> >
> >> On Sat, 07 Jul 2018 at 23:45:27, Mathieu Lirzin wrote:
> >>> Lukas Fleischer <address@hidden> writes:
> >>> 
> >>> > As of Python 3.5, but unoptimized and optimized bytecode are stored
> >>> > within .pyc files; .pyo files are no longer generated. Update the Python
> >>> > tests such that the test do not fail if .pyo files are missing.
> >>> 
> >>> Like in other message, it is important that the test suite passes
> >>> with older python version.  Have you checked?
> >>
> >> Note that this patch only removes some checks, so after this patch,
> >> everything is strictly less restrictive. I don't see how this could
> >> possibly break backwards compatibility.
> >>
> >> Nevertheless, I just made sure that everything still works with Python
> >> 2.7.15.
> >
> > OK I overlooked that.  I think a inlined comment in the concerned tests
> > explaining why python object files presence is not tested would help
> > future code reader to understand.
> >
> > Can you send an updated patch?
> Please forget the updated patch fornow.  I have just remember about
> about bug#30556 [1] where test suite is known to fail when ‘python’ is
> ‘python3’ and not ‘python2’ which is the case on Arch Linux.  Sorry for
> the confusion.

I don't quite understand. Note that it is the automake test suite, not
Arch Linux, that does not conform with PEP 394. While PEP 394 mentions
that all distributions *should* ensure that python refers to python2, it
also mentions that this is not necessarily always the case. The document
also says that "[...] python should be used in the shebang line only for
scripts that are source compatible with both Python 2 and 3" and "in
preparation for an eventual change in the default version of Python,
Python 2 only scripts should either be updated to be source compatible
with Python 3 or else to use python2 in the shebang line."

So, we should either rewrite the test cases to explicitly use python2
or, even better, keep using python and make the tests work with both
Python 2 and Python 3, the latter of which is achieved by the two
patches I submitted. Any rationale on why they should be "forgotten for

> You seem to have a better understanding of how various version of python
> handles compilation and caches than I do.  Maybe can you summarize (give
> some pointers)  the various evolution in that regard?

__pycache__ directories were introduced in Python 3.2 (for details, see
PEP 3147 [1]). PYO files were removed in Python 3.5 (see PEP 488 [2]).

Best regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]