picotool icon indicating copy to clipboard operation
picotool copied to clipboard

P8tool can't seem to write files

Open KyleNeubarth opened this issue 2 years ago • 3 comments

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?

KyleNeubarth avatar Apr 10 '22 17:04 KyleNeubarth

Possibly fixed by https://github.com/dansanderson/picotool/pull/90 , I'll try to get this merged in.

dansanderson avatar Apr 29 '22 00:04 dansanderson

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 avatar May 09 '22 21:05 KyleNeubarth

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

KyleNeubarth avatar May 09 '22 21:05 KyleNeubarth