Comments (7)
Hmm, interesting. I'm not sure how this broke with 1.9.0 -- it looks like this problem has been there for a long time. It's caused because sys.platform is sunos5
on this OS, and PosixDirEntry
is defined if ctypes is not None and have_dirent_d_type
, but used if ctypes is not None
without the extra clause.
However, can you please tell me what is the version of scandir installed when it works, i.e., the scandir<1.9.0
in your case?
from scandir.
It installed 1.8.0.
from scandir.
I found this while doing borgbackup testing and resurrecting the openindiana vagrant box now as the vagrant change that broke oi boxes was found. I'll try to reproduce this with a clean virtualenv in a minute...
from scandir.
In a clean python 3.4.7 virtual env:
started at 1.5.0, upgrading scandir via pip install scandir==V
for V in 1.6.0, 1.7.0, 1.8.0, 1.9.0.
it definitely does not traceback with <= 1.8.0, but tracebacks after upgrading to 1.9.0.
from scandir.
OK, guess I have the reason why it crashes:
- if the c extension is built / available, it does not crash
- so there is a different behaviour for [not] building the c ext on openindiana since 1.9.0 when the package is normally installed from pypi
- if the c extension is not available, it crashes due to the bad 2nd if-condition that does not match the 1st one. this bug was there since long, but it did not get noticed as building the c ext usually worked in < 1.9.0. fixed by #111.
from scandir.
OK, guess I have why the C ext building was broken:
Because vagrant did not support openindiana for a while and was just recently fixed, my openindiana box was a bit outdated. Some stuff (e.g. current Cython, maybe also scandir?) now wanted gcc-6 which somehow was not there (yet). So my first tries to build that stuff failed when it tried to compile C stuff - but I guess pip cached a wheel for scandir 1.9.0 made at that time (and thus: without _scandir C extension).
Later, i fixed by updating the system and also installing gcc-6.
But, as pip had a cached wheel for scandir 1.9.0, it continued using this and thus missed the C extension.
I killed ~/.cache/pip
later and now a freshly pip-installed scandir 1.9.0 does have the C extension and thus does not trigger the exception any more.
So seems like this rather was a caching issue than a build problem rooted in scandir setup code.
But at least we found a bug, so please merge #111.
from scandir.
Excellent, thanks. I just merged #111.
from scandir.
Related Issues (20)
- scandir 1.9.0 broken in Python 2.7.13 HOT 7
- drop old/dead pythons? HOT 9
- test on py37? HOT 2
- pypy3 stat issue HOT 2
- preparing changelog for next release HOT 1
- Request for new release to PyPI >= 1.9.0 HOT 1
- Fix locale/unicode test failures on FreeBSD HOT 1
- Error from running setup.py install on python 2.7.5 win HOT 5
- is there any way to read all file names in the sub directory? HOT 3
- Difference between scandir.walk() and os.walk() HOT 4
- The macOS wheels produced by scandir are overly restrictive in their platform HOT 1
- Wheel support for linux aarch64 HOT 1
- some doubt about your another project :pygit HOT 3
- GIL is not released when dir_entry.stat does a stat syscall HOT 6
- Running on Outdated Python and OS HOT 2
- Windows MAX_PATH limitation on inode call HOT 6
- module FTBFS on python3.9 and 3.10 HOT 2
- 3 fields are labelled "unnamed field" in `repr(scandir.DirEntry.stat())` HOT 3
- Compile error, "storage size of 'st' isn't known, Python 3.11, gcc 12.2.0. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scandir.