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

Scan aborted with NoneType has no attribute "read"/"tell" when parsing relics #41

Open
kel-z opened this issue Dec 16, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@kel-z
Copy link
Owner

kel-z commented Dec 16, 2023

I honestly have no clue where this error might originate from in the code. I was using the release version so I wasn't able to get a full stack trace--it must have something to do with relic_strategy.py since it aborted in middle of parsing the relics. It happened to me once and then never again.

@kel-z kel-z added the bug Something isn't working label Dec 16, 2023
@kel-z
Copy link
Owner Author

kel-z commented Feb 24, 2024

added a stack trace to the log for v0.6.2

if this happens to anyone, please comment with the stack trace here

@kel-z kel-z changed the title Scan aborted with NoneType has no attribute "read" when parsing relics Scan aborted with NoneType has no attribute "read"/"tell" when parsing relics Feb 24, 2024
@gxjest1
Copy link

gxjest1 commented Mar 5, 2024

Scanned with +100 delay on both nav and scan speed with the wall of the Astral Express parlor car (dark grey) as the background

[13:20:32] [INFO] > Starting scan...
[13:20:33] [INFO] > Scanning light cones...
[13:20:40] [INFO] > Quantity: 116/150.
[13:21:18] [INFO] > Reached minimum rarity filter (got rarity 3).
[13:21:20] [INFO] > Finished scanning light cones.
[13:21:20] [INFO] > Scanning relics...
[13:21:27] [INFO] > Quantity: 279/1 500.
[13:23:03] [INFO] > Reached minimum rarity filter (got rarity 3).
[13:23:05] [INFO] > Finished scanning relics.
[13:23:05] [INFO] > Scanning characters...
[13:23:08] [INFO] > Character total: 36/44.
[13:25:03] [INFO] > Finished scanning characters.
[13:25:03] [INFO] > Starting OCR process. Please wait...
[13:25:04] [FATAL] > Scan aborted with error AttributeError: 'NoneType' object has no attribute 'read'
Stack trace: "Traceback (most recent call last):
File "main.py", line 581, in run
File "asyncio\runners.py", line 44, in run
File "asyncio\base_events.py", line 646, in run_until_complete
File "services\scanner\scanner.py", line 188, in start_scan
File "asyncio\threads.py", line 25, in to_thread
File "concurrent\futures\thread.py", line 58, in run
File "services\scanner\parsers\light_cone_strategy.py", line 227, in parse
File "PIL\Image.py", line 2157, in resize
File "PIL\ImageFile.py", line 280, in load
File "PIL\PngImagePlugin.py", line 974, in load_end
AttributeError: 'NoneType' object has no attribute 'read'
" (Try increasing nav/scan delay in the scanner settings, or scan with a different in-game background, window resolution, or fullscreen/windowed mode.)

@kel-z
Copy link
Owner Author

kel-z commented Mar 5, 2024

Thank you! I finally see where the problem is coming from. Looks like one of the images used for template matching can fail to load for some unknown reason, which results in attempted function calls on a 'None' image. Probably suffice to add guards to check if the image is loaded to prevent this error from happening again.

@gxjest1
Copy link

gxjest1 commented Mar 5, 2024

Awesome. thank you for all of the work you do on this. I find the scanner and optimizer to be extremely helpful/valuable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants