Help with error
119z opened this issue · 2 comments
Hi there,
I tried to use the tool again today after a loong time, but I got met with an error. Any idea if it's something on my end? I'm using python 3.8 because I need that version specifically for another project. I'm on Windows 11.
this is my config.json
{
"downloadDirectory": "C:\Users\danie\OneDrive\Documents\TS4\#TS4 Mods\CC",
"maxActiveDownloads": 4,
"saveDownloadQueue": true,
"debug": false
}
and this is the error i got.
C:\Users\danie\OneDrive\Documents\TS4\The-Sims-Resource-Downloader-0.4.0>python src/main.py
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\logging_init_.py", line 1081, in emit
msg = self.format(record)
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\logging_init_.py", line 925, in format
return fmt.format(record)
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\logging_init_.py", line 664, in format
record.message = record.getMessage()
File "C:\Users\danie\AppData\Local\Programs\Python\Python38\lib\logging_init_.py", line 369, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\Users\danie\OneDrive\Documents\TS4\The-Sims-Resource-Downloader-0.4.0\src\logger.py", line 23, in exceptionHandler
logging.exception(type, value, tb)
Message: <class 'TypeError'>
Arguments: (TypeError("unsupported operand type(s) for |: 'type' and 'NoneType'"), <traceback object at 0x0000015CB5DBACC0>)
Traceback (most recent call last):
File "src/main.py", line 1, in
from TSRUrl import TSRUrl
File "C:\Users\danie\OneDrive\Documents\TS4\The-Sims-Resource-Downloader-0.4.0\src\TSRUrl.py", line 6, in
class TSRUrl:
File "C:\Users\danie\OneDrive\Documents\TS4\The-Sims-Resource-Downloader-0.4.0\src\TSRUrl.py", line 16, in TSRUrl
def __getItemId(self, url: str) -> int | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
It does seem like an issue with type annotations on Python 3.8, thankfully there is a module called __future__
which seems to fix the issue.
Branch: https://github.com/Xientraa/The-Sims-Resource-Downloader/tree/Python-Future
this worked perfectly! thank you so much for your help.