FunKiiU icon indicating copy to clipboard operation
FunKiiU copied to clipboard

Run in background error?

Open simplesteph opened this issue 8 years ago • 8 comments

Hi,

I'm trying to do the following command to run the downloads in the background

nohup python ./FunKiiU.py -title XXXXX -onlinetickets &> test.log

If I run python ./FunKiiU.py -title XXXXX -onlinetickets everything is fine, but as soon as I launch i with nohup, I'm getting the following error in my log:

$ cat test.log 
nohup: ignoring input
*******
FunKiiU 2.2 by cearp and the cerea1killer
*******

Downloading/updating data from wiiu.titlekeys.com
-Downloading titlekeys.json.
-File size is None.
-File in disk is 83944.
Downloaded data OK!
Traceback (most recent call last):
  File "./FunKiiU.py", line 441, in <module>
    tickets_only=arguments.tickets_only)
  File "./FunKiiU.py", line 402, in main
    process_title_id(title_id, title_key, name, region, output_dir, retry_count, onlinetickets, patch_demo, patch_dlc, simulate, tickets_only)
  File "./FunKiiU.py", line 248, in process_title_id
    log('Simulate: Would start work in in: "{}"'.format(rawdir))
  File "./FunKiiU.py", line 426, in log
    print(output.encode(sys.stdout.encoding, errors='replace'))
TypeError: encode() argument 1 must be string, not None

is there something wrong with the script?

simplesteph avatar Nov 05 '16 00:11 simplesteph

What python version?

And that is strange... I have no idea about nohup or running this in the background.

But I'll search on google about it. Thanks for telling me.

llakssz avatar Nov 05 '16 12:11 llakssz

ptyhon 2.7. It'd be great if this was compatible with nohup

simplesteph avatar Nov 05 '16 13:11 simplesteph

Personally I have used screen and just detach when I ran the 3ds versions of this tool remotely, but nohup looks useful!

Quickly, it looks like these projects had a similar problem. I will see what they did.

https://github.com/ejwa/gitinspector/issues/19 https://github.com/ansible/ansible/issues/8644 https://github.com/aws/aws-cli/issues/1898

llakssz avatar Nov 05 '16 15:11 llakssz

the use case for me is to launch the downloads after ssh into my raspberry pi, and forget about them even if I close the ssh connection

simplesteph avatar Nov 06 '16 00:11 simplesteph

FYI - setting export PYTHONIOENCODING=utf-8 before running nohup works... Now just need to have that in the script

simplesteph avatar Nov 06 '16 00:11 simplesteph

but that is something to do with the terminal/bash etc right? so, would it be right for FunKiiU to change that for the user?

good that it works though.

llakssz avatar Nov 06 '16 11:11 llakssz

I think so could set it short lived for os.environ() during just the python program, in case that env variable doesn't exist ?

simplesteph avatar Nov 06 '16 21:11 simplesteph

I'm having problems with "screen", it seems that when I dettach the screen (ctrol+a, d) the script freezes.

ilazgo avatar Apr 25 '17 08:04 ilazgo