Author Oliver Smith
Recipients Oliver Smith
Date 2017-03-03.07:09:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.)

# Output:
# contents of /tmp/destination (should have -> obviously mounted):
# os.path.ismount(): False

# create source and destination folders
mkdir -p $source $destination

# add the python script in the source folder
echo "import os.path" >> $source/
echo "print('os.path.ismount(): ' + str(os.path.ismount('$destination')))" >> $source/

# do the mount --bind
sudo mount --bind $source $destination
echo "contents of $destination (should have -> obviously mounted):"
ls $destination

# show the python bug
python3 $source/

# clean up
sudo umount $destination
rm $source/
rm -d $source $destination
Date User Action Args
2017-03-03 07:09:34Oliver Smithsetrecipients: + Oliver Smith
2017-03-03 07:09:34Oliver Smithsetmessageid: <>
2017-03-03 07:09:34Oliver Smithlinkissue29707 messages
2017-03-03 07:09:33Oliver Smithcreate