Le 17/11/2019 à 11:45, Wayne Blaszczyk via blfs-dev a écrit : > Hi All, > > I have just noticed that with all my builds, there are __pycache__ directories > being installed all over the place. > As an example, when I installed totem, it created /usr/bin/__pycache__/ with a > bunch of files underneath it which are actual not related to totem. > I raised a bug but it was quickly dismissed. > https://gitlab.gnome.org/GNOME/totem/issues/375 > I know that totem is not part of BLFS anymore, but there are other packages > creating the same sort thing. > Polkit for example has created files under > /usr/lib/gobject-introspection/giscanner/__pycache__/ > Has anyone else come across this? Is this expected? >
I think it is expected: each time a python program is interpreted, it is actually transformed to an intermediate binary (byte-compiled). Under certain conditions, this binary is saved into the __pycache__directory, so that the next time it is run, the binary is used, saving the time for byte-compiling. There is also a python module for byte-compiling all the files in a directory [1]. As a specific example, gedit has a post_install.py script, which does byte-compile all the python programs in /usr/lib/gedit/plugins. I think it is the same for totem (although creating __pycache__ directly in /usr/bin should be avoided, IMO). Pierre [1] https://docs.python.org/3/library/compileall.html -- http://lists.linuxfromscratch.org/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page