SPECS: python.spec - non-python *.py in /usr/bin were crashing
som...
wrobell
wrobell at pld-linux.org
Wed Feb 16 15:51:11 CET 2005
On Wed, Feb 16, 2005 at 03:03:26PM +0100, michal salaban wrote:
> on Wed, Feb 16, 2005 at 01:49:49PM +0100, wrobell wrote:
>
> > twistd should remove /usr/bin from its sys.path
>
> really? it's default behaviour for all python applications to import from it's
> base directory. why twisted should change it?
And there should be no modules in /usr/bin directory to import.
> inconsistency comes from python package, not twisted, so there it should be
> fixed, i think.
It is a Python bug/stupidity. Why anybody should care how Python modules are
named? Due to Python being too smart, one has to check if his scripts
names are not: gettext.py, smptd.py, email.py, etc. They are common names
and quite usable for own scripts.
IMHO, the problem is not with twisted nor with python package. It is with
Python itself. I've been told that PEP 328 will solve this issue, but this
PEP is not implemented yet as I know. Still I do not understand how PEP 328
will solve this problem. Please follow:
http://sourceforge.net/tracker/index.php?func=detail&aid=946373&group_id=5470&atid=305470
> > > the other, better solution is to copy or link original python scripts to
> > > /usr/bin. i'm currently working on it.
> > if you run a script as root and then python will not try to create *.py[co]
> > file in /usr/bin... but then twistd will import pdb from /usr/bin?
>
> you're right. it's not good, too.
>
> so the question is - do the scripts in /usr/bin have to have .py extension,
> even if they're not python scripts? is it any convention or other rule that we
> have to follow?
They do not have... but how to call them? If you follow comp.lang.python
or other sources, there is always reference to timeit.py, pdb.py not other
names. So it would be a good idea to follow this tradition in our distro.
The problem is more general and hits any user. It should be solved but
renaming files is not the solution. Of course changing twistd script
sucks too, but the change is not visible to user when the real fix
in Python arrives.
Until the Python is fixed I've declared to fix such situations. So, if you
revert the change in python.spec I will add appropriate patch to twisted
package.
wrobell <wrobell at pld-linux.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /mailman/pipermail/pld-devel-en/attachments/20050216/25ec82d5/attachment-0002.bin
More information about the pld-devel-en
mailing list