Author Anthony Sottile
Recipients Anthony Sottile
Date 2017-11-03.23:51:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za>
In-reply-to
Content
Fortunately, this can be reproduced with the testsuite:

```
======================================================================
ERROR: test_copystat_symlinks (__main__.TestShutil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.6/test/test_shutil.py", line 366, in test_copystat_symlinks
    os.lchmod(src_link, stat.S_IRWXO)
OSError: [Errno 95] Not supported: '/tmp/tmplfli9msi/baz'

```

My simplest reproduction involves docker:

```dockerfile
FROM alpine
RUN apk update && apk add curl python3

RUN mkdir foo && ln -s /dev/null foo/bar

CMD [ \
    "python3", "-c", \
    "import shutil; shutil.copytree('foo', 'bar', symlinks=True)" \
]
```

```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.6/shutil.py", line 359, in copytree
    raise Error(errors)
shutil.Error: [('foo/bar', 'bar/bar', "[Errno 95] Not supported: 'bar/bar'")]
```


By looking at pyconfig, I get the following:

```
/ # grep -E '(HAVE_FCHMODAT|HAVE_LCHMOD)' /usr/include/python3.6m/pyconfig.h 
#define HAVE_FCHMODAT 1
#define HAVE_LCHMOD 1
```

But it seems lchmod is actually nonfunctional in this case.

I think the fix is to augment `configure` to detect faulty `lchmod` and not set `HAVE_LCHMOD`?  I'm not terribly familiar with the autotools pipeline but that's where I'm going to take a stab at it!

I'm originally finding this issue via https://github.com/pre-commit/pre-commit/issues/655
History
Date User Action Args
2017-11-03 23:51:13Anthony Sottilesetrecipients: + Anthony Sottile
2017-11-03 23:51:13Anthony Sottilesetmessageid: <1509753073.77.0.213398074469.issue31940@psf.upfronthosting.co.za>
2017-11-03 23:51:13Anthony Sottilelinkissue31940 messages
2017-11-03 23:51:13Anthony Sottilecreate