Message288863
After mounting a folder to another folder on the same filesystem with mount --bind, os.path.ismount() still returns False on the destination folder (although there is a mountpoint).
A shell script to reproduce this is below.
(Maybe this can be fixed by using /proc/mounts (if available, may not be the case eg. for chroots) for verifying, if the destination folder is really a mountpoint on POSIX/Linux. Although I am not sure how consistent that is through POSIX.)
---
#!/bin/sh
# Output:
# contents of /tmp/destination (should have test.py -> obviously mounted):
# test.py
# os.path.ismount(): False
# create source and destination folders
source=/tmp/source
destination=/tmp/destination
mkdir -p $source $destination
# add the python script in the source folder
echo "import os.path" >> $source/test.py
echo "print('os.path.ismount(): ' + str(os.path.ismount('$destination')))" >> $source/test.py
# do the mount --bind
sudo mount --bind $source $destination
echo "contents of $destination (should have test.py -> obviously mounted):"
ls $destination
# show the python bug
python3 $source/test.py
# clean up
sudo umount $destination
rm $source/test.py
rm -d $source $destination |
|
Date |
User |
Action |
Args |
2017-03-03 07:09:34 | Oliver Smith | set | recipients:
+ Oliver Smith |
2017-03-03 07:09:34 | Oliver Smith | set | messageid: <1488524974.65.0.103028894103.issue29707@psf.upfronthosting.co.za> |
2017-03-03 07:09:34 | Oliver Smith | link | issue29707 messages |
2017-03-03 07:09:33 | Oliver Smith | create | |
|