Opened 12 years ago
Last modified 3 years ago
#38986 closed defect
python 2.7 ENOTSUP vs. EOPNOTSUPP discrepancies — at Initial Version
Reported by: | kabaev@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.3 |
Keywords: | Cc: | ||
Port: | python27 |
Description
Hi,
Apple's system python errno module contains discrete values for EOPNOTSUPP (102) and ENOTSUP (45), while python build by macports only has EOPNOTSUPP (102) value. When values are discrete, both are required to be defined as globals in the errno module.
The EOPNOTSUPP vs ENOTSUP distinction also breaks copystat routine in shutils module when run on Mac OS X. Shutils contains this code that makes all chflags operation errors to be ignored if underlying OS does not support them:
if (not hasattr(errno, 'EOPNOTSUPP') or
why.errno != errno.EOPNOTSUPP): raise
In reality, when the file system (say, NFS) does not support file flags, it returns the value of 45 in errno, which corresponds to ENOTSUP. The code used to work when ENOTSUP and EOPNOTSUPP were mapped to the same value, but is ineffective now. It cannot be fixed trivially either because errno.ENOTSUP is not present in errno module, as per above. I suggest the patch be committed to python port to 1. make sure errno.ENOTSUP is always defined, and, 2. shutils are adjusted to use errno.ENOTSUPP in the above chflags workaround. I'll see about submitting the patch to upstream, if it is still needed, but would really like so see the workaround in the port meanwhile. Without it one cannot use tools like scons on NFS mounted source trees - scons uses shutils to to the file copying and installation and it trips over chflags errors from NFS right away.