On 12 October 2001, Johann Visagie said:
> Expert, no. But the DOS/Windows null device is indeed NUL. I've just
> checked that this still exists on Win2K, at least.
Great. Can someone intrepid Quixote-on-Windows user try a few things
for us:
* set DEBUG_LOG = None in the config file and start a Quixote
application (eg. access "/q/" if you've installed the demo
according to the instructions in doc/demo.txt)
* if Windows does not recognize "/dev/null" (as we suspect), it should
crash
(If it does *not* crash, please try this in a Python interactive session:
f = open("/dev/null", "a")
print >>f, "to the bit bucket"
I'm curious what happens.)
Then try applying this patch:
--- publish.py 2001/10/09 21:38:15 1.99
+++ publish.py 2001/10/12 14:25:09
@@ -44,2 +44,11 @@
+if os.name == "posix":
+ NULL_FILE = "/dev/null"
+elif os.name == "nt":
+ NULL_FILE = "NUL"
+else:
+ # Will bomb if-and-only-if we enter setup_logs() with
+ # config.debug_log unset.
+ NULL_FILE = None
+
class Publisher:
@@ -136,3 +145,3 @@
# to the bit-bucket.
- sys.stdout = open('/dev/null', 'w')
+ sys.stdout = open(NULL_FILE, 'w')
else:
...and see if it works (ie. doesn't crash) this time.
Thanks --
Greg
--
Greg Ward - software developer gward@mems-exchange.org
MEMS Exchange http://www.mems-exchange.org