Since you're at it, this part (which I coded myself) doesn't make sense, because the final output is a unicode object. So this can be changed to:

```python
content = content.decode(encoding)
```