django unittests TypeError

Hi everyone,

I am trying to run django unittests for a project.
I get the following error in django unittests at this step: Creating test database for alias ‘default’…

TypeError: cannot use a string pattern on a bytes-like object.

In my opinion this error occurs when trying to translate byte arrays to a string without providing an encoding. However, this is an internal process of django. Therefore I have no idea how to fix it.

Does anyone have an idea?

This is frequently also an issue when you’re trying to run code written for Python 2 in Python 3. What versions of Python and Django are you running? What else can you tell us about your configuration and the system you’re trying to run this on?

Thank you for answering me. I am currently using Python 3.9 and Django 2.2

From FAQ: Installation | Django documentation | Django

Django version Python versions
2.2 3.5, 3.6, 3.7, 3.8 (added in 2.2.8), 3.9 (added in 2.2.17)

Are you up to sub-version 2.2.17?

Thank you for the hint. I will check this and then let you know how it goes. Maybe updating Django will solve problem.