Only close open file handles on windows, since on Unix, it creates so far undiagnosed issues

This commit is contained in:
Kovid Goyal 2010-09-30 14:34:14 -06:00
parent b16ede44fb
commit 52aaef4407

View File

@ -13,6 +13,7 @@ from Queue import Queue
from contextlib import closing from contextlib import closing
from binascii import unhexlify from binascii import unhexlify
from calibre import prints from calibre import prints
from calibre.constants import iswindows
PARALLEL_FUNCS = { PARALLEL_FUNCS = {
'lrfviewer' : 'lrfviewer' :
@ -77,7 +78,9 @@ def get_func(name):
def main(): def main():
# Close open file descriptors inherited from parent # Close open file descriptors inherited from parent
os.closerange(3, 1000) # as windows locks open files
if iswindows:
os.closerange(3, 1000)
from calibre.constants import isosx from calibre.constants import isosx
if isosx and 'CALIBRE_WORKER_ADDRESS' not in os.environ: if isosx and 'CALIBRE_WORKER_ADDRESS' not in os.environ:
# On some OS X computers launchd apparently tries to # On some OS X computers launchd apparently tries to