[ python-Bugs-1438185 ] os.renames() crashes NTFS junctions

2006-02-26 Thread SourceForge.net
Bugs item #1438185, was opened at 2006-02-24 10:03
Message generated for change (Comment added) made by logistix
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1438185&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Windows
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Daniel Rohlfing (damiro)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.renames() crashes NTFS junctions

Initial Comment:
Hello

There is a problem using os.renames() with a path, 
that was created as a ntfs junction.

You will find more information about junctions and a 
tool to create them on:
http://www.sysinternals.com/Utilities/Junction.html
The source is also available there.

Try this to reproduce the problem:

*in DOS*
mkdir C:\dir1
echo >>C:\dir1\old.txt
junction.exe C:\dir2 C:\dir1

*in Python*
>>> import os
>>> os.renames("C:\\dir2\\old.txt", "C:\\dir2
\\new.txt")

If you now look in 'dir1' you will find new.txt
thats fine, but junction 'dir2' not longer exist.

os.rename() is not affected by this problem.

My OP is Windows 2000 [Version 5.00.2195] with SP4 and 
im using Python 2.4.2

I hope you will find this information usefull.

greets from germany
Daniel Rohlfing


--

Comment By: Grant Olson (logistix)
Date: 2006-02-26 17:23

Message:
Logged In: YES 
user_id=699438

Patch 1439312 posted.

--

Comment By: Grant Olson (logistix)
Date: 2006-02-25 17:02

Message:
Logged In: YES 
user_id=699438

This is because 'os.rmdir' doesn't throw an exception when
deleting a junction, since it doesn't really have any files
under it.  Does look like a bug to me though.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1438185&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1438537 ] modules search in help() crashes on insufficient file perms

2006-02-26 Thread SourceForge.net
Bugs item #1438537, was opened at 2006-02-25 03:41
Message generated for change (Comment added) made by logistix
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1438537&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: A. Coder (hauptbeuteltier)
Assigned to: Nobody/Anonymous (nobody)
Summary: modules search in help() crashes on insufficient file perms

Initial Comment:
In the python interpreter, in the interactive online
help, typing modules 
throws a permission denied error (Errno 13) and dumps
the user back to the main interpreter if the user has
insufficient permission to read any .py file from the
site-packages directory.


Example:
~:$ ls -l /usr/lib/python2.4/site-packages/pygtk.py
-rw-r-  1 root root 2619 2005-02-20 14:18
/usr/lib/python2.4/site-packages/pygtk.py
~:$ python
>>> help()

help> modules html

Here is a list of matching modules.  Enter any module
name to get more help.

HTMLParser - A parser for HTML and XHTML.
htmlentitydefs - HTML character entity references.
htmllib - HTML 2.0 parser.
markupbase - Shared support for scanning document type
declarations in HTML and XHTML.
pydoc - Generate Python documentation in HTML or text
for interactive use.
test.test_htmllib 
test.test_htmlparser - Tests for HTMLParser.py.
Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.4/site.py", line 328, in __call__
return pydoc.help(*args, **kwds)
  File "/usr/lib/python2.4/pydoc.py", line 1650, in
__call__
self.interact()
  File "/usr/lib/python2.4/pydoc.py", line 1668, in
interact
self.help(request)
  File "/usr/lib/python2.4/pydoc.py", line 1686, in help
self.listmodules(split(request)[1])
  File "/usr/lib/python2.4/pydoc.py", line 1790, in
listmodules
apropos(key)
  File "/usr/lib/python2.4/pydoc.py", line 1900, in apropos
ModuleScanner().run(callback, key)
  File "/usr/lib/python2.4/pydoc.py", line 1886, in run
desc = synopsis(path) or ''
  File "/usr/lib/python2.4/pydoc.py", line 182, in synopsis
file = open(filename)
IOError: [Errno 13] Permission denied:
'/usr/lib/python2.4/site-packages/tageditor.py'
>>>

--

Comment By: Grant Olson (logistix)
Date: 2006-02-26 17:32

Message:
Logged In: YES 
user_id=699438

That patch sounds pretty-much right, but I think it should
print some feedback to stderr instead of silently swallowing
the exception.

--

Comment By: splitscreen (splitscreen)
Date: 2006-02-25 06:34

Message:
Logged In: YES 
user_id=1126061

Could this just be silently skipped? i.e returning None if
the user does not have the corrept permissions to access a
particular file?

Just wrap the 'file = open(filename)' in pydoc.py: line 182
in a try: except block returning None if there's an error
(such as permission denied).

I have written a patch I can supply if anyone wants it and
if this is the Right Thing To Do (TM).


--

Comment By: A. Coder (hauptbeuteltier)
Date: 2006-02-25 03:44

Message:
Logged In: YES 
user_id=1420716

My apologies. The tageditor.py file had the same permissions
for my test as pygtk.py. The particular file is irrelevant
in this case, it only matters that a user has insufficient
permissions for any file in the site-packages directory.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1438537&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com