Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for recognition and handling of Windows junctions. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cb109
Copy link
Contributor

@cb109 cb109 commented Aug 16, 2014

Hi Martin,

When I gave riffle a try on my Windows 7 machine, it failed for folders like 'C:\Documents and Settings' or 'C:\Users\USER\Cookies' with 'Windows Error 5: Access denied'. This happens because these folders are junctions that are softlinked to other, real directories. I added support for them (using existing functionality from jaraco.windows) and thought it may be worth sharing. Feel free to decline in case you don't fancy it, had fun writing it anyway ;)

Cheers,
Christoph

@martinpengellyphillips
Copy link

Great - thanks!

I'll just do some additional testing and make sure it doesn't affect other platforms, but it seems like a useful addition.

try:
os.listdir(path)
accessDenied = False
except WindowsError as e:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

careful about this exception, as it does exist only under windows....
just discovered at my expenses ;)

Copy link
Contributor Author

@cb109 cb109 Jun 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. It should probably be OSError then instead, from which WindowsError is a subclass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants