<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 07/17/2012 10:34 AM, Victor Stinner
wrote:<br>
</div>
<blockquote
cite="mid:CAMpsgwaNK+Hot3moRo4BYgh9BQJHfJmRDJOANB2HsnNMwEK3nA@mail.gmail.com"
type="cite">
<pre wrap="">Python 3.3 introduced os.supports_dir_fd to check if some os functions
do accept a file descriptor instead of a path. The problem is that
os.supports_dir_fd is a list of functions, not a list of function
names. If os functions are monkey patched, you cannot test anymore if
a function supports file descriptor.</pre>
</blockquote>
<br>
If you're monkey-patching the function, you can monkey-patch
os.supports_dir_fd too.<br>
<br>
<blockquote
cite="mid:CAMpsgwaNK+Hot3moRo4BYgh9BQJHfJmRDJOANB2HsnNMwEK3nA@mail.gmail.com"
type="cite">
<pre wrap="">Monkey patching is a common practice in Python. test_os.py replaces
os.exec*() functions temporary for example.
</pre>
</blockquote>
<br>
For testing, yes. It's not recommended for production code.<br>
<br>
<br>
<i>/arry</i><br>
</body>
</html>