Skip to content

Running crypt4gh-keygen results in an error when ~/.c4gh does not exist #49

@RichardJActon

Description

@RichardJActon

Whilst it is reasonably simple to infer from this error (see below) that making the ~/.c4gh directory before running this command again would likely remedy the issue, (it does), it appears to be an unhandled error and it would likely be better UX to simply create this directory if it does not yet exist.

Traceback (most recent call last):
  File "/nix/store/apkrykxp4lcssnj2adi81amzayb6h4vl-python3.13-crypt4gh-1.7/bin/.crypt4gh-keygen-wrapped", line 9, in <module>
    sys.exit(main())
             ~~~~^^
  File "/nix/store/apkrykxp4lcssnj2adi81amzayb6h4vl-python3.13-crypt4gh-1.7/lib/python3.13/site-packages/crypt4gh/keys/__init__.py", line 188, in main
    sys.exit(run(argv))
             ~~~^^^^^^
  File "/nix/store/apkrykxp4lcssnj2adi81amzayb6h4vl-python3.13-crypt4gh-1.7/lib/python3.13/site-packages/crypt4gh/keys/__init__.py", line 181, in run
    c4gh.generate(seckey, pubkey, passphrase=passphrase1, comment=comment)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/apkrykxp4lcssnj2adi81amzayb6h4vl-python3.13-crypt4gh-1.7/lib/python3.13/site-packages/crypt4gh/keys/c4gh.py", line 73, in generate
    with open(seckey, 'bw') as f:
         ~~~~^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/richardjacton/.c4gh/key'

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