sqlalchemy can't read null dates from sqlite3 (0000-00-00): ValueError: year is out of range
<p>When I try to query a database containing dates such as <code>0000-00-00 00:00:00</code> with <code>sqlachemy</code>, I get <code>ValueError: year is out of range</code>.</p>

<p>Here's the db dump:</p>

<p><a href="https://i.stack.imgur.com/k6wiR.png" rel="nofollow"><img src="https://i.stack.imgur.com/k6wiR.png" alt="enter image description here"></a></p>

<p>Here's the stacktrace:</p>

<pre><code>File "/home/rob/.virtualenvs/calif/lib/python3.5/site-packages/sqlalchemy/engine/result.py" in items
  163.         return [(key, self[key]) for key in self.keys()]

File "/home/rob/.virtualenvs/calif/lib/python3.5/site-packages/sqlalchemy/engine/result.py" in &lt;listcomp&gt;
  163.         return [(key, self[key]) for key in self.keys()]

File "/home/rob/.virtualenvs/calif/lib/python3.5/site-packages/sqlalchemy/engine/result.py" in __getitem__
  90.                 return processor(self._row[index])

File "/home/rob/.virtualenvs/calif/lib/python3.5/site-packages/sqlalchemy/processors.py" in process
  48.                 return type_(*list(map(int, m.groups(0))))

Exception Type: ValueError at /
Exception Value: year is out of range
</code></pre>

<p>Is this normal ? Can sqlalchemy read dates like that ? Is this a python limitation ? Is there a workaround to keep the date as-is (not converting to None) ?</p>

<p>Got the answer via <code>inklesspen</code> on IRC: <a href="https://docs.python.org/2/library/datetime.html#datetime.MINYEAR" rel="nofollow">Python datetime representation has <strong>minimum year</strong> and it's <strong>1</strong></a></p>

python sqlalchemy