-
Notifications
You must be signed in to change notification settings - Fork 45
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
Error trying to call writep8 #73
Comments
As an update - I tried this on a linux box as just the standard out-of-the-box tool and I get the same issue: /git/picotool$ ls -l |
A bit late, but in my experience it's better to use the zip archive than the repo itself. P.S. Looks like picotool is not able to parse code from newer cartridges, like the one you mentioned, but it is still able to parse assets from them. |
Cool - I'll try the zip archive when I get back to this (kinda put it on hold since then) |
Hi,
I'm writing a discord bot and I want people to be able to convert Pico8 png files to p8 files.
I'm trying to call the writep8 capability directly.
I was hitting errors, adn I though it was to do with the format of my png files, which i was writing out from the discord bot, so I downloaded a pico8 png directly and am using it as a test.
Here's the code:
args = ["writep8", "C:\Users\Gamer\Downloads\pico8\grapplicious-0.p8.png"]
tool.main(args)
I'm getting this error:
Ignoring exception in command pico8:
Traceback (most recent call last):
File "C:\Users\Gamer\git\discord-bot-v1\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Gamer\git\discord-bot-v1\admin\admin_commands.py", line 71, in pico8
tool.main(args)
File "C:\Users\Gamer\git\discord-bot-v1\pico8\tool.py", line 596, in main
return args.func(args)
File "C:\Users\Gamer\git\discord-bot-v1\pico8\tool.py", line 398, in do_writep8
return process_game_files(args.filename, writep8, args=args)
File "C:\Users\Gamer\git\discord-bot-v1\pico8\tool.py", line 268, in process_game_files
procfunc(g, out_fname, args=args)
File "C:\Users\Gamer\git\discord-bot-v1\pico8\tool.py", line 288, in writep8
g.to_file(filename=out_fname)
File "C:\Users\Gamer\git\discord-bot-v1\pico8\game\game.py", line 723, in to_file
self.to_p8png_file(outfh, filename=filename, *args, **kwargs)
File "C:\Users\Gamer\git\discord-bot-v1\pico8\game\game.py", line 689, in to_p8png_file
code_bytes = self.get_bytes_from_code(b''.join(cart_lua))
File "C:\Users\Gamer\git\discord-bot-v1\pico8\game\game.py", line 492, in get_bytes_from_code
code_bytes = bytes(code, 'ascii')
TypeError: encoding without a string argument
This should work calling the code like this (as far as I can see) but it does not
The text was updated successfully, but these errors were encountered: