[Buildroot] pycompile script doesn't compile files with single character names

Charles Eidsness charles at ccxtechnologies.com
Thu Dec 17 11:58:03 UTC 2020


On Thu, 17 Dec 2020 at 03:22, Julien Floret <julien.floret at 6wind.com> wrote:
>
> Hi Charles,
>
> Le mer. 16 déc. 2020 à 14:37, Charles Eidsness via buildroot
> <buildroot at busybox.net> a écrit :
> >
> > Hi All,
> >
> > I'm not sure if this is by design but the pycompile utility won't compile single character python files. This causes an issue if you've selected pyc files only and are building python-dnspython, which has some single character filenames.
> >
> > Here is a simple fix:
> >
> > diff --git a/support/scripts/pycompile.py b/support/scripts/pycompile.py
> > index 7041a0506b..e2cfc2683c 100644
> > --- a/support/scripts/pycompile.py
> > +++ b/support/scripts/pycompile.py
> > @@ -30,7 +30,7 @@ def compile_one(host_path, strip_root=None, verbose=False):
> >          return  # only compile real files
> >
> >      if not re.match(
> > -            r"^[_A-Za-z][_A-Za-z0-9]+\.py$", os.path.basename(host_path)
> > +            r"^[_A-Za-z][_A-Za-z0-9]*\.py$", os.path.basename(host_path)
> >      ):
> >          return  # only compile "importable" python modules
> >
>
> Your fix looks good to me. Could you send a git patch using "git
> send-email", so that it can be applied by the maintainers?
> Thanks!
>
> Julien

Hi Julien,

I don't have git send-email setup but used git format-patch and sent
out an email, hopefully it'll work.

Thanks!
Charles



More information about the buildroot mailing list