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

<class 'AttributeError'> - 'NoneType' object has no attribute 'date' #7

Open
the0x1d3 opened this issue Aug 28, 2024 · 1 comment
Open

Comments

@the0x1d3
Copy link

the0x1d3 commented Aug 28, 2024

Dear Dev,

I have this error:

`2024-08-28 10:32:08 :: [product.py ] - [release_date_extractor ] - [ERROR ] - Release date does not have a Z for the asin B0CR5PRBVW.

2024-08-28 10:32:08 :: [main.py ] - [ ] - [CRITICAL] - Error during bot execution: <class 'AttributeError'> - 'NoneType' object has no attribute 'date'`

I'll start by saying that I've been using the bot for about 2 weeks without any problems. In the last few days it's giving me this error. How can I fix it?

@Piero24
Copy link
Owner

Piero24 commented Aug 29, 2024

Hi @the0x1d3 , First of all, thank you for choosing my bot for your Telegram channel. The more people use it, the more I can maintain and improve it in the future. Unfortunately, at the moment, my API key has expired because there haven’t been any recent purchases through my link. For this reason, I can’t fix any bugs on my own until a purchase is made through my link.

However, I think I’ve identified the issue. If you can run some tests, we can check what’s causing the error. Specifically, the product you mentioned with ASIN: B0CR5PRBVW does not have a release date. In the file: /src/utils/product.py, the method release_date_extractor wasn’t handling the error properly. It handles the error if the release is None, but something must have happened that prevented it from processing correctly.

Go to the file: /src/utils/product.py and modify the release_date_extractor method as follows:

else:
            logging.error(f"Release date does not have a Z for the "
                        f"asin {asin}.")
            logging.error(f"{release} -- {release is None} -- {type(release)}")

After doing this, you need to force the program to search for that ASIN (B0CR5PRBVW) again. This way, we can see what’s causing the error and proceed to resolve it.

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