Message279086
I agree to use setmode() at _pyio module for Cygwin. However, I have two reasons that I disagree to the implementation of os.setmode().
First, FreeBSD has another setmode() that operate file permission bits [1]. Therefore the implementation of os.setmode() will be confused to those users.
Second, msvcrt.setmode() isn't used almost in standard library, the function is just used by _pyio module and subprocess test. Thus I think there aren't much need that implements setmode() to os module.
Easy way for a solution of import error on Cygwin, setmode() is implemented on _pyio using ctypes. then Cygwin CPython forget setmode().
Otherwise it's hard way, For avoiding confliction to other platforms, I'd propose to create the cygwin module. I thought a solution implementing imitation msvcrt module, but it is unreasonable because Cygwin doesn't have other Windows API.
I tried written the patch of easy way that implements setmode() into _pyio. This patch is included parts to succeed import _pyio.
[1] https://www.freebsd.org/cgi/man.cgi?query=setmode&sektion=3 |
|
Date |
User |
Action |
Args |
2016-10-20 22:03:26 | masamoto | set | recipients:
+ masamoto, erik.bray |
2016-10-20 22:03:26 | masamoto | set | messageid: <1477001006.29.0.791459197414.issue28459@psf.upfronthosting.co.za> |
2016-10-20 22:03:26 | masamoto | link | issue28459 messages |
2016-10-20 22:03:26 | masamoto | create | |
|