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

Python 3.12 not supported #58

Open
zeevro opened this issue Jul 19, 2023 · 4 comments
Open

Python 3.12 not supported #58

zeevro opened this issue Jul 19, 2023 · 4 comments

Comments

@zeevro
Copy link

zeevro commented Jul 19, 2023

construct<2.10 uses the imp module, which was removed on Python 3.12. Is there a reason not to use a more recent construct version?

@Hyask
Copy link

Hyask commented Aug 16, 2023

Also, the construct-typing package must be installed for properly type checking a project that uses construct. Unfortunately, construct-typing requires construct>=2.10.

Looking at the changelog, it doesn't seem like there were big removals or changes in the API. The only removal are Embedded and EmbeddedSwitch, but they don't seem to be in use in pdbparse, according to grep.

@moyix given your recent activity on this repo, do you think that would be doable for you to release a new version of pdbparse with the construct<2.10 constraint loosened? I can help provide feedback on this if need be.

@Hyask
Copy link

Hyask commented Aug 17, 2023

Just to let people know, here is how I fixed the problem on my side:

  • edit setup.py with a new version and install_requires=["construct>=2.10", "construct<2.11", "pefile"]
  • run python3 -m build
  • the built wheel and source package (in ./dist) both work fine in my use-case, which is only getting a PDB's GUID:
def get_pdb_guid(filename_path: Path) -> str:
    try:
        p = pdbparse.parse(filename_path, fast_load=True)
        pdb = p.streams[pdbparse.PDB_STREAM_PDB]
        pdb.load()

        return (
            "%08x%04x%04x%s%x"
            % (
                pdb.GUID.Data1,
                pdb.GUID.Data2,
                pdb.GUID.Data3,
                binascii.hexlify(pdb.GUID.Data4).decode("ascii"),
                pdb.Age,
            )
        ).upper()
    except Exception as e:
        raise RuntimeError(e)

I've no idea if the rest of the pdbparse package work fine with a newer construct, but at least that's a start.

@Hyask
Copy link

Hyask commented Aug 17, 2023

For those interested, you can put this line in your requirements.txt to use the version I mentioned just above:

pdbparse @ https://github.com/tetrane/pdbparse/raw/f29816285a5cbaf00bfe8c10379e664a5e4118ac/dist/pdbparse-1.5.1.tar.gz#sha256=1b046f137bc5b807983b15c1a1c71360faffad658be0ee4ba05763b0ab428486

@pombredanne
Copy link
Contributor

@moyix gentle ping, what's the longer term plan for this project?

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