[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2021-05-02 Thread R0b0t1


R0b0t1  added the comment:

https://bugs.python.org/issue29707#msg331921
> But what is the problem with getting False for bind mounts on the same 
> filesystem?

When doing directory traversal it is important to not duplicate listings. It 
seems this can cause duplication. I'm replying to echo Mikko Korkalo's 
sentiment, this really should not have been closed.

This should likely be addressed along with https://bugs.python.org/issue23407.

--
nosy: +R0b0t1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2020-02-04 Thread Mikko Korkalo


Mikko Korkalo  added the comment:

I disagree about whether this should be fixed or not.
It's definitely a bug. If you ask whether a bind mount destination is a mount, 
it should return true.

I wrote a logic that does bind mounting. The logic cannot use ismount() because 
it does not work for me, it would keep remounting the same bind mount.

Not fixing this just causes people to write even less portable hackery on their 
own. I have to parse /proc/mounts or something manually, which obviously should 
be the job of ismount().
Python has a lot of platform-specific underlying implementations anyway.

--
nosy: +Mikko Korkalo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2019-04-09 Thread Christian Heimes


Christian Heimes  added the comment:

Yes, it can be closed as doc-only fix.

--
nosy: +christian.heimes
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2019-04-09 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Can this be closed as a documentation only change?  Thanks!

--
nosy: +cheryl.sabella

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2019-01-15 Thread miss-islington


miss-islington  added the comment:


New changeset a4aade2cf82dfa889c2bdad9fa0aa874f43c0bf8 by Miss Islington (bot) 
in branch '3.7':
bpo-29707: Document that os.path.ismount() is not able to reliable detect bind 
mounts. (GH-11238)
https://github.com/python/cpython/commit/a4aade2cf82dfa889c2bdad9fa0aa874f43c0bf8


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2019-01-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11199, 11200, 11201

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2019-01-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11199

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2019-01-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11199, 11200

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2019-01-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 32ebd8508d4807a7c85d2ed8e9c3b44ecd6de591 by Serhiy Storchaka in 
branch 'master':
bpo-29707: Document that os.path.ismount() is not able to reliable detect bind 
mounts. (GH-11238)
https://github.com/python/cpython/commit/32ebd8508d4807a7c85d2ed8e9c3b44ecd6de591


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am not sure that we need to change ismount(), but its behavior should be 
documented.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +10470
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-16 Thread Eryk Sun


Eryk Sun  added the comment:

> what is the problem with getting False for bind mounts 
> on the same filesystem?

Probably there's no problem if it's consistently false for all bind mounts on 
the same file system, but ismount() is true for a bind mount to the parent 
directory on the same file system, since the inodes match.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I do not think that we should use /proc/mounts or getmntent ,because they are 
not portable. os.path.ismount() uses the traditional way to detect mountpoints 
which is not able to detect bind mounts.

But what is the problem with getting False for bind mounts on the same 
filesystem?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-15 Thread Eryk Sun


Change by Eryk Sun :


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-15 Thread Eryk Sun


Eryk Sun  added the comment:

It's also inconsistent. ismount() is true for a bind mount to the parent 
directory (e.g. dir/mount -> dir).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2018-12-15 Thread Eryk Sun


Change by Eryk Sun :


--
nosy: +eryksun
stage:  -> needs patch
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2017-08-31 Thread Alex Richman

Alex Richman added the comment:

Can confirm, ran into this issue.  It's because os.path.ismount() works by 
checking if the path's parent is on a different device (e.g. st_dev is the same 
for 'path/' and 'path/..'), which obviously it is for a bind mount on the same 
filesystem.

It is actually documented that this is how it works 
(https://docs.python.org/2/library/os.path.html#os.path.ismount) but it's more 
of a passing comment than a warning, and who reads the docs for such an 
apparently simple function anyway? ;)

Agree that it should be fixed by parsing /proc/mounts instead of the current 
mess, perhaps using getmntent(3) and friends.

--
nosy: +Alex Richman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2017-03-02 Thread ollieparanoid

New submission from ollieparanoid:

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

--
components: Library (Lib)
messages: 288863
nosy: Oliver Smith
priority: normal
severity: normal
status: open
title: os.path.ismount() always returns false for mount --bind on same 
filesystem
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com