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

P8tool can't seem to write files #99

Open
KyleNeubarth opened this issue Apr 10, 2022 · 3 comments
Open

P8tool can't seem to write files #99

KyleNeubarth opened this issue Apr 10, 2022 · 3 comments

Comments

@KyleNeubarth
Copy link

Hi, I've just setup picotool but any command that tries to create a file seems to be failing. I've followed the installation instructions exactly, but I get the following traceback whenever I try to run the build or write commands.

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\kyle\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\pico8\\game\\empty_023.p8.png'  

My python is version 3.10.2, pip is version 22.0.4 and picotool itself. I'm running picotool on Windows 10.

Has anyone else run into this issue? Or perhaps there is another reason why picotool is failing to write temporary files in its package directory?

@dansanderson
Copy link
Owner

Possibly fixed by #90 , I'll try to get this merged in.

@KyleNeubarth
Copy link
Author

So, I added the one line modified mentioned in the PR and now the error is based on not passing a string to the bytes() function. Wondering if perhaps I'm doing something else wrong here? I've included the whole stack trace, apologies if it's a bit long.

Traceback (most recent call last):
File "C:\Users\kyle\AppData\Local\Programs\Python\Python310\Scripts\p8tool-script.py", line 33, in
sys.exit(load_entry_point('p8tool==0.1', 'console_scripts', 'p8tool')())
File "C:\Users\kyle\AppData\Local\Programs\Python\Python310\lib\site-packages\pico8\tool.py", line 625, in main
return args.func(args)
File "C:\Users\kyle\AppData\Local\Programs\Python\Python310\lib\site-packages\pico8\build\build.py", line 302, in do_build
file.to_file(
File "C:\Users\kyle\AppData\Local\Programs\Python\Python310\lib\site-packages\pico8\game\file.py", line 90, in to_file
fmt.to_file(game, outfh, filename=filename, *args, **kwargs)
File "C:\Users\kyle\AppData\Local\Programs\Python\Python310\lib\site-packages\pico8\game\formatter\p8png.py", line 275, in to_file
code_bytes = get_bytes_from_code(b''.join(cart_lua))
File "C:\Users\kyle\AppData\Local\Programs\Python\Python310\lib\site-packages\pico8\game\formatter\p8png.py", line 159, in get_bytes_from_code
code_bytes = bytes(code, 'ascii')
TypeError: encoding without a string argument

@KyleNeubarth
Copy link
Author

The command that caused this error is as follows, main.lua is a file which only contains "print("hello world!")".

p8tool build test.p8.png --lua ./source/main.lua

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

2 participants