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 error str and None #7

Closed
anance25 opened this issue May 27, 2022 · 6 comments
Closed

Python error str and None #7

anance25 opened this issue May 27, 2022 · 6 comments

Comments

@anance25
Copy link

anance25 commented May 27, 2022

Ubuntu 20.04
Python 3.8.10

Running into this issue when attempting to run spray365.

$ python3 spray365.py

Traceback (most recent call last):
  File "spray365.py", line 2, in <module>
    from modules.core.output import console
  File "/home/nancea/Spray365/modules/core/output/console.py", line 74, in <module>
    line_terminator: str | None,
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

EDIT to fix formatting

@MarkoH17
Copy link
Owner

This is caused by Python versions < 3.10 not having the NoneType type constant.

I'll update the README to indicate Python3.10 is the recommended version.

And in the meantime, I'll add a patch to support our type checking that causes this issue in older Python versions.

@MarkoH17
Copy link
Owner

@anance25 ,

This should be fixed in f475f73. Can you pull the latest version and retry?

@anance25
Copy link
Author

@MarkoH17 i wasn't sure from your comment if i should pull again and try with 3.8.10, but i did. Slightly different error this time:

$ python3 spray365.py

Traceback (most recent call last):
  File "spray365.py", line 3, in <module>
    from modules.generate import generate
  File "/home/nancea/Spray365/modules/generate/generate.py", line 2, in <module>
    from modules.generate.modes import audit, normal
  File "/home/nancea/Spray365/modules/generate/modes/audit.py", line 9, in <module>
    from modules.core.credential import Credential
  File "/home/nancea/Spray365/modules/core/credential.py", line 1, in <module>
    class Credential:
  File "/home/nancea/Spray365/modules/core/credential.py", line 7, in Credential
    client_id: tuple[str, str],
TypeError: 'type' object is not subscriptable

I ended up installing 3.10 from ppa on this ubuntu 20.04 box i was using and now its working. Again, not sure if the intent was to get versions as old as 3.8 working, but thanks for clarifying what was needed. You might also mention in the readme that ubuntu 20.04 does not want to work with python 3.10 out of the box, and it took some elbow grease to get that working.

@MarkoH17
Copy link
Owner

@anance25,

My mistake! I thought I read you were using Python 3.9, so I intended to get it working for that version. I guess it is reasonable to try to get this working for Python 3.8, so I'll see what I can do about that.

Thanks for helping out with this. I'll circle back when I've made some progress.

@MarkoH17
Copy link
Owner

MarkoH17 commented Jun 1, 2022

@anance25,

Spray365 version 0.2.1-beta was released today. As of 20b8d2b, Spray365 should run in older Python 3 environments (3.7+). Can you pull the latest release and see if it works in your Python 3.8.10 environment?

@MarkoH17
Copy link
Owner

Just tested Spray365 v0.2.1-beta on Python 3.8.13, and it appears functional.

image

Closing this issue for now. Feel free to open a new one if you see any more compatibility issues.

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

2 participants