osmcode / pyosmium

Python bindings for libosmium
https://osmcode.org/pyosmium
BSD 2-Clause "Simplified" License
318 stars 65 forks source link

Fix AttributeError: 'int' object has no attribute 'decode' #193

Closed wiktorn closed 2 years ago

wiktorn commented 2 years ago

When using pyosmium-get-changes, which use urllib to download changes from remote server it was failing due to the fact, that call to urllib.response.readline() was returning bytes, which were in the for loop interpeted one by one.

lonvia commented 2 years ago

The Python 3.5 problem was actually a problem of building against pybind11 master, which is not the best idea. I've fixed the CI runs on master. And hopefully I've stop Appveyor from doing stuff, too. Can you rebase and remove the CI changes?

wiktorn commented 2 years ago

Removed the commit and rebased.

lonvia commented 2 years ago

While investigating the memory leak and writing tests, I realized that this can be done in an even simpler way, see https://github.com/osmcode/pyosmium/blob/7ab5ec6abbd79d6d8171f4872c06d32545ec5ec2/src/osmium/replication/server.py#L328-L334 Could you quickly check if master still works for you? If not we really need a test to reproduce the issue.

wiktorn commented 2 years ago

Sure, let me check

wiktorn commented 2 years ago

Ok, confirmed that it still works. Thanks, and indeed it's a ton simpler.