msg66921 - (view) |
Author: Ismail Donmez (donmez) * |
Date: 2008-05-16 07:25 |
os module have varios O_ declerations but it doesn't define O_ASYNC. Same for fcntl module which doesn't define FASYNC. Simply defining O_ASYNC = 020000 works fine but its not as elegant as saying os.O_ASYNC. |
|
|
msg66922 - (view) |
Author: Andrii V. Mishkovskyi (mishok13) |
Date: 2008-05-16 08:16 |
These flags are non-posix, linux-specific constants. Python 'os' module uses 'posix' module for all *nix systems, including those, that do not support O_ASYNC and FASYNC flags. I think your feature request should be rejected. |
|
|
msg66923 - (view) |
Author: Ismail Donmez (donmez) * |
Date: 2008-05-16 08:31 |
I think they at least should be supported on Linux then. It does work if you use the value itself anyway. |
|
|
msg66924 - (view) |
Author: Andrii V. Mishkovskyi (mishok13) |
Date: 2008-05-16 08:55 |
>I think they at least should be supported on Linux then. And what happens if some Unix flavor (i.e. Solaris) adds new flag, say O_NONLINUXSYNC and it has the same value as linux's O_ASYNC? And then FreeBSD adds O_BSDSYNC flag with the same number and so on. Then Python will have to have separate system-specific module for each *nix system that uses Python. Why do you think Python maintainers would want that? >It does work if you use the value itself anyway. It's the way fcntl works -- it's just a thin layer on top of fcntl() and ioctl() calls. But that's not a good reason for including non-posix flags to 'posix' module |
|
|
msg66925 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-05-16 09:25 |
Platform-specific values are not a problem. On win32 os.O_NOINHERIT == 128, and on linux os.O_EXCL has the same value. Python just exposes the available #defines at the module level. (btw, the posix module is also available on windows. It is named 'nt', but it is really the same module) And in posixmodule.c, There are already some "GNU extensions": os.O_DIRECT, os.O_NOFOLLOW... |
|
|
msg66931 - (view) |
Author: Ismail Donmez (donmez) * |
Date: 2008-05-16 11:33 |
Add O_ASYNC and FASYNC as GNU extensions. |
|
|
msg66932 - (view) |
Author: Ismail Donmez (donmez) * |
Date: 2008-05-16 11:35 |
Python code already has GNU/Windows only exceptions. Attached patch adds O_ASYNC and FASYNC as GNU extensions. If accepted I can send a complimentary documentation patch. |
|
|
msg66937 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-05-16 13:10 |
OK, committed patch in r63368. Thanks! |
|
|
msg66938 - (view) |
Author: Ismail Donmez (donmez) * |
Date: 2008-05-16 13:12 |
Thanks, can you also apply to py3k branch? :) |
|
|
msg66939 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-05-16 13:15 |
That will happen automatically. |
|
|
msg66942 - (view) |
Author: Ismail Donmez (donmez) * |
Date: 2008-05-16 13:30 |
Documentation patch is added too. |
|
|
msg66945 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-05-16 13:42 |
Thanks, applied in r63373. |
|
|