[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-24 Thread R. David Murray

R. David Murray added the comment:

Thanks, Xiang.  Also thanks to SilentGhost, who noticed the buildbot failure I 
missed.

--
stage: needs patch -> 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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 63799c310b69 by R David Murray in branch '2.7':
#2466: fix test failure on windows.
https://hg.python.org/cpython/rev/63799c310b69

--

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-23 Thread Xiang Zhang

Xiang Zhang added the comment:

Oh, sorry. Upload bot_failure_fix.patch to fix this.

--
Added file: http://bugs.python.org/file44207/bot_failure_fix.patch

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-23 Thread R. David Murray

R. David Murray added the comment:

This is causing a test failure on the windows 8 bot.  Can you fix it Xiang?  
Otherwise I'll have to revert.

http://buildbot.python.org/all/builders/AMD64%20Windows8%202.7/builds/870

==
ERROR: test_islink (test.test_posixpath.PosixPathTest)
--
Traceback (most recent call last):
  File "D:\buildarea\2.7.bolen-windows8\build\lib\test\test_posixpath.py", line 
110, in test_islink
os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2")
AttributeError: 'module' object has no attribute 'symlink'

==
ERROR: test_ismount_symlinks (test.test_posixpath.PosixPathTest)
--
Traceback (most recent call last):
  File "D:\buildarea\2.7.bolen-windows8\build\lib\test\test_posixpath.py", line 
221, in test_ismount_symlinks
os.unlink(ABSTFN)
WindowsError: [Error 2] The system cannot find the file specified: 
'D:\\buildarea\\2.7.bolen-windows8\\build\\build\\test_python_2024/@test_2024_tmp'

--

--
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-23 Thread R. David Murray

R. David Murray added the comment:

Thanks, Xiang.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 75111791110b by R David Murray in branch '2.7':
# 2466: ismount now recognizes mount points user can't access.
https://hg.python.org/cpython/rev/75111791110b

--

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread Xiang Zhang

Xiang Zhang added the comment:

David, issue2466_ismount_py2.7_port.patch does the py2.7 port. I also back port 
other ismount test cases not existing in py2.7.

--
nosy: +xiang.zhang
Added file: http://bugs.python.org/file44145/issue2466_ismount_py2.7_port.patch

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dd0f1fa809c5 by R David Murray in branch 'default':
Rewrap long lines in Misc/NEWS.
https://hg.python.org/cpython/rev/dd0f1fa809c5

--

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread R. David Murray

R. David Murray added the comment:

Thanks, Robin.

The patch doesn't apply on 2.7.  I'll leave this open to see if anyone wants to 
do the 2.7 port.

--
nosy: +r.david.murray
stage: commit review -> needs patch
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cbc78ca21977 by R David Murray in branch '3.5':
#2466: ismount now recognizes mount points user can't access.
https://hg.python.org/cpython/rev/cbc78ca21977

New changeset db9126139969 by R David Murray in branch 'default':
Merge: #2466: ismount now recognizes mount points user can't access.
https://hg.python.org/cpython/rev/db9126139969

--
nosy: +python-dev

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, forget, this doesn't work with path like "./.". Agreed, using realpath() is 
the simplest solution.

--

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-06-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What if use os.stat(dirname(path)) instead of os.lstat(parent)?

-if isinstance(path, bytes):
-parent = join(path, b'..')
-else:
-parent = join(path, '..')
 try:
-s2 = os.lstat(parent)
+s2 = os.stat(dirname(path))
 except OSError:
 return False

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-06-03 Thread Robin Roth

Robin Roth added the comment:

Based on the review by SilentGhost I removed all refactoring-changes and only 
left the one line needed for the fix.

--
Added file: 
http://bugs.python.org/file43140/minimal_fix_ismount_directory_not_readable.patch

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-06-03 Thread SilentGhost

Changes by SilentGhost :


--
stage: patch review -> commit review
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-04-22 Thread Robin Roth

Robin Roth added the comment:

Any progress on merging this?
The fix is simple, there is a test; anything else I can do to help?

Ansible integrated the patch posted here as a workaround of an issue this 
caused. So there was some external review of the fix. See
https://github.com/ansible/ansible-modules-core/pull/2737

--
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2015-12-17 Thread Robin Roth

Robin Roth added the comment:

any comments/updates on merging this?

--

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2015-11-14 Thread Robin Roth

Robin Roth added the comment:

Antoine's suggestion does not work, because "dirname" does not cover enough 
cases (for example trailing slash, possibly more).

As suggested by him I now use realpath (instead of abspath). I can't come up 
with a symlink-situation that is broken with the old code, but realpath is what 
"ismount" actually means.

I also added a testcase that resembles the issue, i.e. it fails with the old 
code and passes with the fix. 

I mock the "Permission denied" by raising a generic OSError. Mocking can not 
resemble every real-life situation but by simulating all issues reporting and 
then fixing them, one should get a solid test coverage. 

I also took the liberty of minor cleanup in/around the functions changed, i.e. 
remove unused imports and remove single-use variables to make the code easier 
to read.

Attached the updated patch.

--
Added file: 
http://bugs.python.org/file41041/test_fix_ismount_directory_not_readable.patch

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2015-11-02 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Robin. The patch needs a test case. See 
Lib/test/test_posixpath.py. The test coverage of ismount() is not high, so we 
need more tests. Also, I don't have much time to work on this right now, but 
Antoine's suggestion in msg71294 sounds good to me. Did you try it?

--
nosy: +berker.peksag
stage:  -> patch review
versions:  -Python 2.6, Python 3.0, Python 3.2, Python 3.3

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2015-10-01 Thread Robin Roth

Robin Roth added the comment:

This bug is still present and annoying.
For me it appeared when running ismount on a nfs-mounted directory, when the 
user who runs python has no read permission inside the directory. Therefore the 
lstat on /mntdir/.. fails.
Attached a patch that fixes this by running abspath on the path.

Symlinks will also work because they are checked/excluded before the part of 
the code where the patch is in.

msg222528 is not related to the original bug and should be opened separately.

--
keywords: +patch
nosy: +Robin Roth
Added file: http://bugs.python.org/file40641/ismount-permission.patch

___
Python tracker 

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2014-07-07 Thread Pablo Sole

Pablo Sole added the comment:

I found another case where the result of ismount() is misleading. I'm using a 
FUSE-based filesystem controlled by a python supervisor daemon. 

When the fuse daemon dies and you try to access the filesystem with os.stat() 
it returns:
OSError: [Errno 107] Transport endpoint is not connected: '/tmp/fuse-test'. 
Although, the filesystem is actually mounted and you can verify this:
# cat /proc/self/mountinfo | grep fuse
26 25 0:20 / /tmp/fuse-test rw,nosuid,nodev,relatime - fuse /dev/fuse 
rw,user_id=1000,group_id=1000,default_permissions,allow_other

If the idea of ismount() is to show what paths are mountpoints, in this case it 
should return True, even if it's non-accessible (the fuse daemon died in this 
case, it might also happen for a stale NFS mount *not checked* ).

--
nosy: +pablo.sole

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



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2011-05-31 Thread Dave Rawks

Dave Rawks d...@pandora.com added the comment:

Confirm this problem exists in 2.7 as well.

--
nosy: +drawks
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2466
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2008-08-17 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

Another problem of using os.path.dirname is that for /A/B, it will
return /A, and if /A is itself a symlink to a mount point itself, /A and
/A/B will have different st_dev values... which will be wrongly
interpreted as meaning that /A/B is a mount point.

So here is a possible course of action for ismount:
1- first test if the arg is a symlink and if so, return False (as it
already does today)
2- then use os.path.realname(os.path.dirname(arg)) instead of joining
with ..

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2466
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2008-08-14 Thread Ross Burton

Changes by Ross Burton [EMAIL PROTECTED]:


--
title: os.path.ismount doesn't work for NTFS mounts - os.path.ismount doesn't 
work for mounts the user doesn't have permission to see
versions: +Python 2.5 -Python 2.4

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2466
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2008-08-14 Thread Antoine Pitrou

Antoine Pitrou [EMAIL PROTECTED] added the comment:

 If ismount() used os.path.dirname() instead of appending .., then this
 wouldn't happen.

But it may change the function result if the argument is a symlink to
something (directory or mount point) on another filesystem. It should be
verified before making a decision.

--
nosy: +pitrou
priority:  - normal
versions: +Python 2.6, Python 3.0 -Python 2.5

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2466
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com