Comment 7 for bug 689615

Revision history for this message
Matthias Klose (doko) wrote : Re: pycompile fixes needed for maverick -> natty upgrades

On 13.12.2010 16:21, Martin Pitt wrote:
> The uploaded diff is rather large, and I'm trying to understand it.

backporting fixes.

> The
> referenced bugs all fail on "Requested versions are not installed". So
> that's a check from pycompile and a package requests 2.7, but since we
> still have the old python-minimal installed it doesn't know about this
> version yet?
>
> The changes to public_modules.rtinstall and public_modules.rt remove
> seem irrelevant for this SRU, as we don't support 2.4/2.5 in maverick,
> right?
>
> To me it seems the gut of the required change here is that, is this
> correct?
>
> @@ -235,7 +255,13 @@
> 'only, please use /usr/share/python/bcep to specify '
> 'public modules to skip')
>
> - versions = get_requested_versions(options.vrange, available=True)
> + if options.vrange and options.vrange[0] == options.vrange[1] and\
> + options.vrange != (None, None) and\
> + exists("/usr/bin/python%d.%d" % options.vrange[0]):
> + # specific version requested, use it even if it's not in SUPPORTED
> + versions = set(options.vrange[:1])
> + else:
> + versions = get_requested_versions(options.vrange, available=True)
> if not versions:
> log.error('Requested versions are not installed')
> exit(3)
>
> What other part does actually specify the vrange option?

did I say that?

the changelog is quiet explicit about the changes.

> Is the addition of the --force and -O options related in any way?

yes, pycompile currently silently doesn't do anything when a .pyc file exists, which is wrong. It does the wrong thing for .pyo files, and it doesn't allow forcing byte compilation. These options are what a user of the py_compile standard module would expect.

And it's certainly wrong to ignore the exit status of the compileall subprocesses.