Changes by R. David Murray rdmur...@bitdance.com:
--
stage: - resolved
status: open - closed
superseder: - Drop HAVE_FSTAT: require fstat() to compile/use Python
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12082
Antoine Pitrou added the comment:
For those of you who are concerned with this issue, could you explain your use
case on the following discussion thread:
http://mail.python.org/pipermail/python-dev/2013-May/126285.html ?
I would personally like to remove HAVE_FSTAT and make Python
Chromatix added the comment:
Actually many people try to compile python on an environment with freestanding
C library, so this can be a specific case of that. Is there any issue or thread
where compiling python with freestanding headers is discussed? As this relates
to that.
Shall you remove
Petri Lehtinen added the comment:
Should the defines be removed then, because they're kind of false promises for
the user.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12082
___
Antoine Pitrou added the comment:
My vote is for won't fix. Systems without stat() or fstat() are clearly broken
from Python's point of view; at the very least, they aren't POSIX-compliant.
--
nosy: +pitrou
resolution: - wont fix
___
Python tracker
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
versions: +Python 3.4 -Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12082
___
___
Changes by Chromatix cpmicro...@gmail.com:
--
nosy: +chromatix
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12082
___
___
Python-bugs-list
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12082
___
___
Python-bugs-list
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
nosy: +giampaolo.rodola
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12082
___
___
Petri Lehtinen pe...@digip.org added the comment:
I tried to compile Python 3.3 (from default branch) with DONT_HAVE_FSTAT and
DONT_HAVE_STAT. It seems to depend even more heavily on stat() being available,
in other files than Python/import.c.
With 2.7, it was quite easy to disable the
Josh Triplett j...@joshtriplett.org added the comment:
Rather than checking for a directory, how about just opening foo/__init__.py,
and if that fails opening foo.py?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12082
Petri Lehtinen pe...@digip.org added the comment:
The NullImporter is documented to raise ImportError on directories, not
directories containing __init__.py:
http://docs.python.org/library/imp.html#imp.NullImporter
Checking for __init__.py{,c,o} seems doable to me without having stat().
STINNER Victor victor.stin...@haypocalc.com added the comment:
Should the .pyc/.pyo file writing be disabled altogether
if stat() and/or fstat() is not available.
If we cannot get the file modification time, .pyc/.pyo writing must be
disabled. If your OS/libc/filesystem doesn't have fstat(),
Petri Lehtinen pe...@digip.org added the comment:
STINNER Victor wrote:
If we cannot get the file modification time, .pyc/.pyo writing must be
disabled. If your OS/libc/filesystem doesn't have fstat(), you don't have
file modification, so no .pyc/.pyo write.
Should I go on and write a
Josh Triplett j...@joshtriplett.org added the comment:
Given that GRUB doesn't support writing to filesystems at all, I already have
to set Py_DontWriteBytecodeFlag, so disabling .pyc/.pyo entirely would work
fine for my use case.
--
___
Python
STINNER Victor victor.stin...@haypocalc.com added the comment:
Should I go on and write a patch?
Yes please, write a patch, I will review it.
To emulate a system without stat or fstat, you may use:
#define fstat dont_have_fstat
#define stat dont_have_stat
The link will fail if the code still
Josh Triplett j...@joshtriplett.org added the comment:
GRUB's filesystem drivers don't support reading mtime. And no, no form of
stat() function exists, f or otherwise.
On a related note, without HAVE_STAT, import.c can't import package modules at
all, since it uses stat to check in advance
Petri Lehtinen pe...@digip.org added the comment:
Should the .pyc/.pyo file writing be disabled altogether if stat() and/or
fstat() is not available. In this case, there's no way to check mtimes, right?
--
nosy: +brett.cannon, ncoghlan, petri.lehtinen
versions: +Python 3.1, Python 3.2,
STINNER Victor victor.stin...@haypocalc.com added the comment:
Does your filesystem store the modification time? Why don't you have/want
fstat()? Do you have stat() or a similar function?
--
___
Python tracker rep...@bugs.python.org
New submission from Josh Triplett j...@joshtriplett.org:
Even if pyconfig.h defines DONT_HAVE_STAT and DONT_HAVE_FSTAT (which prevents
the definitions of HAVE_STAT and HAVE_FSTAT), Python still references fstat in
Python/import.c, along with struct stat and constants like S_IXUSR. I ran into
STINNER Victor victor.stin...@haypocalc.com added the comment:
Oh, so it's possible to not have the fstat() syscall. I asked me the question
when I modified import.c (and other files related to importing a module).
--
nosy: +haypo
___
Python tracker
21 matches
Mail list logo