1

I've updated a Django app to Python 3.9 and Django 4.0, and I'm getting an error on launch:

TypeError: expected string or bytes-like object

I tracked it down to this function in python3.9/site-packages/webpack_loader/loader.py:

def filter_chunks(self, chunks):
    filtered_chunks = []

    for chunk in chunks:
        ignore = any(regex.match(chunk)
                     for regex in self.config['ignores'])
        if not ignore:
            filtered_chunks.append(chunk)

    return filtered_chunks

On the line ignore = any(regex.match(chunk)..., regex is undefined.

enter image description here

I ran brew upgrade python, but Homebrew said:

Warning: python 3.9.13_1 already installed

What am I missing?

VikR
  • 4,818
  • 8
  • 51
  • 96
  • Looks like a joke of your IDE. Could you try retyping `regex` manually in both places? Maybe it is whitespace issue or something similar. `regex` variable is 100% fine here, it is defined inside generator. Also could you running from terminal without IDE instead? – STerliakov Jun 28 '22 at 20:45
  • Okay I think you're right. If I ignore that I find a much more solvable-looking error. Thanks! If you post that as an answer I will mark it as the accepted answer. – VikR Jun 29 '22 at 00:17

0 Answers0