[MacPorts] #38986: python 2.7 ENOTSUP vs. EOPNOTSUPP discrepancies

MacPorts noreply at macports.org
Thu May 2 12:22:55 PDT 2013


#38986: python 2.7 ENOTSUP vs. EOPNOTSUPP discrepancies
---------------------------+--------------------------------
 Reporter:  kabaev@…       |      Owner:  macports-tickets@…
     Type:  defect         |     Status:  new
 Priority:  Normal         |  Milestone:
Component:  ports          |    Version:  2.1.3
 Keywords:  errno shutils  |       Port:  python27
---------------------------+--------------------------------
 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.

-- 
Ticket URL: <https://trac.macports.org/ticket/38986>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list