Christian Heimes added the comment:
I have created a C implementation of the stat module for Python 3.4. It
implements all current features, handling for DOOR, PORT, WHT and a fix for
#17913.
The first half of the file has lots of #ifndef checks. I'm not sure if they are
really required. I
Charles-François Natali added the comment:
Christian, could you post it as a mercurial diff for review?
Also, it would maybe be better to rename this issue to rewrite stat module in
C.
Shouldn't we also remove the Python version?
--
nosy: +neologix
Charles-François Natali added the comment:
We've been *adding* python implementations for other modules, so I don't see
why we would remove this one.
Because it's buggy, and cannot be implemented correctly in python.
--
___
Python tracker
R. David Murray added the comment:
We've been *adding* python implementations for other modules, so I don't see
why we would remove this one.
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11016
Antoine Pitrou added the comment:
We've been *adding* python implementations for other modules, so I
don't see why we would remove this one.
Well, the one reason is that the C constants aren't accessible from
Python code. Once the constants are there, the rest is so trivial
that it doesn't
R. David Murray added the comment:
Cannot be implemented correctly in Python is a darned good reason :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11016
___
Changes by Christian Heimes li...@cheimes.de:
--
keywords: +patch
Added file: http://bugs.python.org/file30153/statmodule.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11016
___
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
nosy: +giampaolo.rodola
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11016
___
___
STINNER Victor added the comment:
If we use the C language, I would prefer to only expose what does really exist,
and not add fake functions like:
+#ifndef S_ISDOOR
+# define S_ISDOOR(mode) 0
+#endif
So in:
+static PyMethodDef stat_methods[] = {
+{S_ISDIR, stat_S_ISDIR, METH_O,
STINNER Victor added the comment:
I have created a C implementation of the stat module for Python 3.4.
Oh, your C module is called stat, as the stat module implemented in Python
(Lib/stat.py). What is your plan? Replace completly the Python module with the
C module? It may be nice to keep
Christian Heimes added the comment:
The stat module (or whatever it is going to be in Python 3.4) is missing more
checks than S_ISDOOR:
# Solaris
S_ISDOOR()
S_ISPORT()
# POSIX 1.b real-time extension
S_ISMSG()
S_ISSEM()
S_ISSHM()
# whiteout, translucent file systems
S_ISWHT
--
nosy:
Christian Heimes added the comment:
I have done some research. The POSIX 1.b extensions aren't used on any
supported system (neither Linux nor BSD, Solaris or AIX).
random...@fastmail.us has compiled a list of even more file types:
Heirloom toolchest ls supports:
Jesús Cea Avión added the comment:
After reviewing the code, I agree with Martin v. Löwis that stat.py is a
joke. Neither can we trust the numerical constants (each OS is free to choose a
different meaning) neither the code in filemode() can cope with modes with
more than a bit active (like
Changes by Jesús Cea Avión j...@jcea.es:
--
versions: +Python 3.4 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11016
___
___
Jesús Cea Avión j...@jcea.es added the comment:
Martin, I guess stat deprecation could require a few years and it would be an
extra incompatibility burden between 2.7 and 3.x.
Beside the symbolic constants, why would you see stat deprecated?.
--
Martin v. Löwis mar...@v.loewis.de added the comment:
Am 31.01.2011 12:46, schrieb Jesús Cea Avión:
Jesús Cea Avión j...@jcea.es added the comment:
Martin, I guess stat deprecation could require a few years and it
would be an extra incompatibility burden between 2.7 and 3.x.
Beside the
Antoine Pitrou pit...@free.fr added the comment:
Apparently, contributor have the illusion that the values they put
into the file are somehow standardized, when they are actually not.
Are there actual bugs with that or is it merely a theoretical concern?
--
Martin v. Löwis mar...@v.loewis.de added the comment:
Apparently, contributor have the illusion that the values they put
into the file are somehow standardized, when they are actually not.
Are there actual bugs with that or is it merely a theoretical concern?
Neither, nor (i.e. it's in the
Jesús Cea Avión j...@jcea.es added the comment:
Martin, what if C posix module (or whoever) would export the symbolic
constants, and update stat.py to use those symbolic constants?.
Do you think that would be an improvement?.
--
___
Python tracker
Martin v. Löwis mar...@v.loewis.de added the comment:
Martin, what if C posix module (or whoever) would export the symbolic
constants, and update stat.py to use those symbolic constants?.
Do you think that would be an improvement?.
Improvement compared to what? The status quo? Certainly.
New submission from Antoine Pitrou pit...@free.fr:
Solaris has an additional kind of special files named doors. The standard
headers define the following macro:
#define S_ISDOOR(mode) (((mode)0xF000) == 0xd000)
Perhaps it would be nice to include the equivalent in the stat module.
Jesús Cea Avión j...@jcea.es added the comment:
Thanks for the feature request. It seems trivial to implement, but not trivial
to test :).
I assign this to myself. I will work on it after Mercurial migration is
finished. Getting impatient :).
--
assignee: - jcea
Antoine Pitrou pit...@free.fr added the comment:
Thanks for the feature request. It seems trivial to implement, but not
trivial to test :).
You can test against an existing file, such as /var/run/syslog_door
(given its name, it is unlikely to be anything other than a door)
--
Jesús Cea Avión j...@jcea.es added the comment:
I do know, but when you are working inside a zone, I am not sure you can count
of that file being always present. Syslog even could be disabled or not
available inside a zone.
I am thinking about how to manage OS's with no support for doors.
Antoine Pitrou pit...@free.fr added the comment:
I do know, but when you are working inside a zone, I am not sure you
can count of that file being always present. Syslog even could be
disabled or not available inside a zone.
Then you can just skip the test.
I am thinking about how to
Jesús Cea Avión j...@jcea.es added the comment:
Given the behaviour of Solaris DOORS, the flags selected are very cleverly
chosen. Sensible engineering :).
But now I am wondering... Which organization defines flags like S_IFSOCK or
S_IFIFO?. Posix members?. I am worried about flag collision
Antoine Pitrou pit...@free.fr added the comment:
But now I am wondering... Which organization defines flags like
S_IFSOCK or S_IFIFO?. Posix members?. I am worried about flag
collision between OSs.
They are defined unconditionally in Lib/stat.py.
For instance, if DOORS were a real flag
Jesús Cea Avión j...@jcea.es added the comment:
Antoine, I am not talking about python, I am talking about the UNIX
standarization process. In particular, how a new flag (for filesystems) in an
OS can be skipped and not being reused for some other purpuse in other OS.
Off topic for python,
John Levon movem...@users.sourceforge.net added the comment:
Jesus, yes, it's totally possible that POSIX might define:
(stat.S_IFSOCK + stat.S_IFIFO)
to mean something other than S_IDOOR. However, the POSIX committee
is always careful to respect existing usage. It's vanishingly unlikely
that
Jesús Cea Avión j...@jcea.es added the comment:
I am looking at Linux :-).
Anyway the feedback has been very useful. I will implement this as soon as
mercurial switch is done.
--
___
Python tracker rep...@bugs.python.org
Martin v. Löwis mar...@v.loewis.de added the comment:
I am thinking about how to manage OS's with no support for doors.
Instead of conditionally compile the new STAT, I would rather have
the function always available, but returning FALSE when the OS
doesn't support doors. But what happen if
Martin v. Löwis mar...@v.loewis.de added the comment:
Am 26.01.2011 14:14, schrieb Jesús Cea Avión:
Jesús Cea Avión j...@jcea.es added the comment:
Antoine, I am not talking about python, I am talking about the UNIX
standarization process. In particular, how a new flag (for
filesystems)
32 matches
Mail list logo