harvard-nrg / lochness

Download your data to a data lake.
Other
5 stars 2 forks source link

daemonize.py will fail using python3.7 #1

Closed sguthrie closed 5 years ago

sguthrie commented 5 years ago
Traceback (most recent call last):
  File "find_new_files_process.py", line 134, in main
    stderr=logfile_location+'.stderr', wdir=os.getcwd()
  File ".../daemonize.py", line 58, in daemonize
    stdin = file(stdin, "r")
NameError: name 'file' is not defined

Suggest using open() instead of file()

tokeefe commented 5 years ago

Yep. Fixed!

sguthrie commented 5 years ago

open('filename','a+',0) is unsupported in python3, so the fix will also result in an error:

    stderr = open(stderr, 'a+', 0)
ValueError: can't have unbuffered text I/O

Since having the standard error written in binary doesn't make much sense, maybe we can replace line 63 with stderr = open(stderr, 'a+')

tokeefe commented 5 years ago

Hm. I suppose I didn't run that test on Python 3 after all. Definitely seems to be working this time!