Skip to content

Conversation

@vsafili
Copy link
Contributor

@vsafili vsafili commented Nov 11, 2024

If the directory where the keys are to be stored doesn't exist, all the directories leading to that path need to be created. The check if the path exists checks the existence correctly, but the filename itself was also created as a directory leading to user mode being unusable with the following error:

File "fflogsapi/user_auth.py", line 105, in _generate_ss_x509_cert
with open(self.KEY_PATH, 'wb') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: './fflogsapi/fflogs_auth_redirect_key.pem'

Fix this by running os.makedirs() on the dirname, and not the full path.

While at it, fix the message telling the user to press "any key", as "any key" does not complete the input() call.

If the directory where the keys are to be stored doesn't exist, all the
directories leading to that path need to be created. The check if the
path exists checks the existence correctly, but the filename itself was
also created as a directory leading to user mode being unusable with the
following error:

  File "fflogsapi/user_auth.py", line 105, in _generate_ss_x509_cert
    with open(self.KEY_PATH, 'wb') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: './fflogsapi/fflogs_auth_redirect_key.pem'

Fix this by running os.makedirs() on the dirname, and not the full path.

While at it, fix the message telling the user to press "any key", as
"any key" does not complete the input() call.

Signed-off-by: Vaal Safili <vaal.safili@gmail.com>
Copy link
Owner

@halworsen halworsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks. I'll stage a patch version and publish it 😃

@halworsen halworsen merged commit 2fbef62 into halworsen:master Nov 12, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants