Masayuki Yamamoto added the comment:

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

----------
components: +Library (Lib)
keywords: +patch
nosy: +masamoto
versions: +Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45163/cygwin-pyio-setmode.patch

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

Reply via email to