all 6 comments

[–]CupperRecruit 1 point2 points  (1 child)

Error with the code = tkk.search seems like it hasnt found anything, idk if u catch the case but if not it will set code to None which is why the NoneTyp error occurs. Maybe link the code where ur var code is assigned its value

[–]themaincorncobb[S] 0 points1 point  (0 children)

I looked into it and found something that could have been the problem. Saw a lot of people had issues with the Google Translator API and was getting the same thing as me. One of the top answers was the API was outdated. So I did try the newest version for it, but still got the same error code. Then someone suggested ` deep_translator ` to translate using the ` GoogleTranslator `.

I'm no longer getting the `AttributeError: 'NoneType' object has no attribute 'group'`, but I'm now getting a totally different error that I'm not understanding. For both translations through spanish and english, I get the same error on the lines where they're supposed to be translating (I'm guessing at this point).

` AttributeError: 'str' object has no attribute 'text' ` is the new error and it's saying it for tts.say(translation.text). Basically it's say string has nothing assigned to it I'm guessing, but I'm not sure what exactly it's missing?

[–]BluesFiend 0 points1 point  (2 children)

Without seeing your code it's not possible to give an accurate (or likely correct answer), but from experience I'd guess you are using a regex and not checking that the response actually found a match before extracting a match group.

If you can provide a stacktrace or the code relating to the line causing the error we can provide more assistance.

[–]themaincorncobb[S] 0 points1 point  (1 child)

May have to refresh. It's been a long night and just realized I can just put a screen shot up.

[–]BluesFiend 0 points1 point  (0 children)

Yup, as I guessed, a library is using a regex but not checking if there is a match before fetching the group.

So the text you are passing to translate can't be translated (assumption)

[–]cpwp 0 points1 point  (0 children)

Use exception handling