Skip to content

Manifest generation crashes on python 3 #73

@oscargroppfeldt

Description

@oscargroppfeldt

When generating manifests with python 3, there is a crash in core/crypto.py around line 268, associated with writing to the submanifest file after opening it using: bz2.BZ2File(..., 'w'). Replacing this with bz2open from httk.core.basic resolves the issue.

Relevant traceback from python 3.14.1:

Traceback (most recent call last):
  File "/dedur01/data/oscgr138/devADAQ/workflows/4_screen_orbitals/analyse.py", line 106, in <module>
    for rundir, _ in reader:
                     ^^^^^^
  File "/dedur01/data/oscgr138/httk/src/httk/task/reader.py", line 77, in reader
    manifest_dir(dirpath, manifestfile, os.path.join(dirpath, 'ht.config'), keydir, sk, pk, force=force_remake_manifests)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/dedur01/data/oscgr138/httk/src/httk/core/crypto.py", line 270, in manifest_dir
    manifest_dir(os.path.join(basedir, fulldir), submanifestfile, os.path.join(basedir, fulldir, 'ht.config'), keydir, sk, pk)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/dedur01/data/oscgr138/httk/src/httk/core/crypto.py", line 220, in manifest_dir
    manifestfile.write(pubkey+"\n")
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/dedur01/data/oscgr138/.conda/envs/adaq3/lib/python3.14/bz2.py", line 235, in write
    data = memoryview(data)
TypeError: memoryview: a bytes-like object is required, not 'str'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions