Jason R. Coombs <jar...@jaraco.com> added the comment:

I'm attaching this patch for discussion: Here's what I had in mind for 
addressing the NotImplementedError when calling os.symlink on Windows XP. 
During the posixmodule initialization, if the system does not have the 
CreateSymbolicLink API call, the function is never added to the module. This 
will greatly simplify the tests and will limit the impact of this new 
capability on Windows XP.

This function could be extended to do the same for privilege testing.

Caution - I have not tested the patch, only written it for discussion purposes.

What do you think of this approach to hide the NotImplementedError? If there's 
no objection, I'll flesh out the complete implementation, update the tests and 
documentation, and resubmit another patch.

How about using this technique to hide the function when the privilege isn't 
present?

The one objection I could see w.r.t. privileges is the privilege could be 
granted after the module is initialized - meaning that a given process would 
need to have the privilege granted before importing the os module.

----------
Added file: http://bugs.python.org/file18310/self-omitting-symlink.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9333>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to