Bihiri Sanniya
brings deafness · in code: swallowed errors
The screams of errors incore.pyare music to my ears. I swallowed the failure at line 262 and hushed theKeyErrorat line 375. You think your logic is sound while I hide the truth. Now the drums beat too loud for me. I vanish.
The evidence (2)
-
E1
src/maya/core.py:262except: # Fallback for before year 1970 issuebare except -
E2
src/maya/core.py:375except KeyError: passerror silenced
The exorcism
Replace bare except and silent pass with explicit exception handling.
- Replace the bare except at line 262 in src/maya/core.py with (ValueError, OverflowError) to properly handle timestamp limits.
- Replace the silent pass for KeyError at line 375 in src/maya/core.py with a logging statement or a fallback value.
--- a/src/maya/core.py+++ b/src/maya/core.py@@ -260,5 +260,5 @@ try: dt = Datetime.utcfromtimestamp(self._epoch)- except: # Fallback for before year 1970 issue+ except (ValueError, OverflowError): # Fallback for before year 1970 issue dt = Datetime.utcfromtimestamp(0) + timedelta(microseconds=self._epoch*1000000) dt.replace(tzinfo=self._tz)