From: Chris PeBenito <pebenito@ieee.org>
To: Russell Coker <russell@coker.com.au>,
"selinux-refpolicy@vger.kernel.org"
<selinux-refpolicy@vger.kernel.org>
Subject: Re: __pycache__
Date: Fri, 25 Jan 2019 21:49:54 -0500 [thread overview]
Message-ID: <4b058ca2-e3b5-e8c8-1c1a-2e90b766cb08@ieee.org> (raw)
In-Reply-To: <1857551.fKAPn0m0Tg@liv>
On 1/25/19 5:55 PM, Russell Coker wrote:
> type=AVC msg=audit(1548301606.546:586): avc: denied { write } for pid=8055
> comm="semanage" name="__pycache__" dev="vda" ino=147333
> scontext=unconfined_u:unconfined_r:semanage_t:s0-s0:c0.c1023
> tcontext=unconfined_u:object_r:lib_t:s0 tclass=dir permissive=0
>
> What can we do about these __pycache__ write attempts? Is there something the
> distribution should be doing in terms of automatically generating those cache
> files when packages are installed?
It is possible to precompile the bytecode (Gentoo does this).
python -m py_compile file1.py file2.py ...
or recursively do all .py files:
python -m compileall /path/to/files
If you wanted, you could disable writing the bytecode by adding -B to
the python command, though that's probably not what distros want to do.
https://docs.python.org/3/library/py_compile.html
https://docs.python.org/3/library/compileall.html
--
Chris PeBenito
prev parent reply other threads:[~2019-01-26 2:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 22:55 __pycache__ Russell Coker
2019-01-26 2:49 ` Chris PeBenito [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4b058ca2-e3b5-e8c8-1c1a-2e90b766cb08@ieee.org \
--to=pebenito@ieee.org \
--cc=russell@coker.com.au \
--cc=selinux-refpolicy@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).