Eli Bendersky added the comment:

The fix looks good to me, in general. Could you create a test that goes along?

My only (minor) doubt is whether this should be generalized, in two dimensions:

1. PermissionError is mapped from both EACCES and EPERM. So to make the 2.7 
patch equivalent with 3.x, EPERM should also be checked. That said, Windows 
documents it doesn't really use EPERM 
(http://msdn.microsoft.com/en-us/library/5814770t.aspx).
2. Should this be restricted to Windows? Could there be other platforms that 
exhibit the same behavior? On the other hand, say on Linux, EACCES should not 
happen in a temp dir and so it's good to re-raise it. 

For (2) I don't think doing anything is necessary at this point - the added 
test may help because it can fail for some strange platform at some point and 
then the solution should be obvious. As for (1), adding EPERM into the 
condition probably can't hurt and it will make Python 2.7 behave more 
consistently with 3.x in case of some undocumented Windows behavior.

----------
nosy: +eli.bendersky
stage: needs patch -> patch review

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

Reply via email to