Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run in background error? #26

Open
simplesteph opened this issue Nov 5, 2016 · 8 comments
Open

Run in background error? #26

simplesteph opened this issue Nov 5, 2016 · 8 comments

Comments

@simplesteph
Copy link

simplesteph commented Nov 5, 2016

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?

@llakssz
Copy link
Owner

llakssz commented Nov 5, 2016

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.

@simplesteph
Copy link
Author

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

@llakssz
Copy link
Owner

llakssz commented Nov 5, 2016

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.

ejwa/gitinspector#19
ansible/ansible#8644
aws/aws-cli#1898

@simplesteph
Copy link
Author

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
Copy link
Author

simplesteph commented Nov 6, 2016

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

@llakssz
Copy link
Owner

llakssz commented Nov 6, 2016

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.

@simplesteph
Copy link
Author

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

@ilazgo
Copy link

ilazgo commented Apr 25, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants