madman-bob / python-dataclasses-serialization

Serialize/deserialize Python dataclasses to various other data formats
MIT License
25 stars 11 forks source link

Crash on import in Python 3.8 #13

Closed blfoster closed 3 years ago

blfoster commented 3 years ago

I'm getting the following error importing this library in an AWS Lambda on Python 3.8:

AttributeError: module 'typing' has no attribute '_ClassVar'

The import that raises the error is:

from dataclasses_serialization.json import JSONSerializer

I haven't had a chance to dig into exactly what circumstances lead to the error. I haven't even managed to reproduce it locally. However, I am almost certain that the problem is caused by the backport of dataclasses being pulled in as a dependency regardless of the Python version.

madman-bob commented 3 years ago

A cursory test shows that redundant copies of dataclasses does not, on its own, cause issues. The information provided is insufficient for me to do anything - have you managed to reproduce the error yet?