a python inquiry (ifsitegen.py)

this is not an interactive fiction crisis. I’ve completed my task already on my old laptop

I got a new PC not long ago, and I needed to release some Inform games for the short games showcase. These are games with graphics and visual styling, and I rely on the ifsitegen.py script for preserving these features.

I installed python (I only ever use it for releasing Inform games in this way). The script throws an error and appears to exit.


C:\staging\ifsitegen.py:65: SyntaxWarning: "\P" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\P"? A raw string is also an option.
  - Windows: C:\Program Files\Inform 7, ~\My Documents\Inform
Traceback (most recent call last):
  File "C:\staging\ifsitegen.py", line 98, in <module>
    from chunk import Chunk
ModuleNotFoundError: No module named 'chunk'

line 65 appears to be a comment, so I’m not sure what the error is on about.

I noted that the version of Python on my old laptop is 3.9.13, while the new version is 3.14.0. I attempted to download 3.9, but it is no longer available “as a binary” and I don’t really know how to deal with that.

It’s very possible–likely, even–that I’ve just configured something incorrectly, but in case that isn’t so I thought I’d make a post. Again, this isn’t very pressing, but if there’s something I ought to do with my new PC I’d like to get it working.

I apologize that I don’t know enough about this to provide better information!

1 Like

Unfortunately, the chunk module was deprecated in Python 3.11 and removed from the standard library in Python 3.13. For legacy applications (like this one!), you can get it through PyPI: run pip install standard-chunk, which I think should work the same on Windows as on Linux.

Since the chunk library is incredibly simple, you can also just download this file and save it as chunk.py in the same directory as ifsitegen.py. That’s probably simpler, and will keep working forever.

5 Likes

I think you may prefer https://iplayif.com/api/sitegen to ifsitegen.py in the future.

2 Likes

I recommend the parchment site generator all the time. It’s great!

But it doesn’t preserve any of my bisquixe features, unless I’ve missed a step.

Thanks for looking at this! I get past that error, but I’m getting a new one.

C:\Users\crank\OneDrive\Documents\Inform\Projects\01a release area\ifsitegen.py:65: SyntaxWarning: "\P" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\P"? A raw string is also an option.
  - Windows: C:\Program Files\Inform 7, ~\My Documents\Inform
Traceback (most recent call last):
  File "C:\Users\crank\OneDrive\Documents\Inform\Projects\01a release area\ifsitegen.py", line 98, in <module>
    from chunk import Chunk
  File "C:\Users\crank\OneDrive\Documents\Inform\Projects\01a release area\chunk.py", line 121
    <title>python-deadlib/chunk/chunk/__init__.py at main · youknowone/python-deadlib · GitHub</title>
                                                          ^
SyntaxError: invalid character '·' (U+00B7)

That looks like you might have literally downloaded the link given (which is Github’s HTML presentation of things about the file chunk/__init__.py).
I think you need to instead go to the link in your browser and press the icon two right from “Raw” above the code, which has the tooltip “Download raw file”.

2 Likes

You’re right! Python complained about chunk, but the site works fine. Thanks all!

Oh, I should update the script to include the chunk code. I already did that for blorbtool.py.

…I’ve updated https://eblong.com/zarf/blorb/ifsitegen.py .

5 Likes

Great! Thank you.