scrapy-jsonrpc icon indicating copy to clipboard operation
scrapy-jsonrpc copied to clipboard

Refactored for Python3 compatibility

Open candale opened this issue 7 years ago • 6 comments

Refactored the code so that is Python3 compatible. It mostly had trouble when dealing with bytes and returning keys from dictionaries.

I also added object in the inheritance for JsonResource and Webservice because their base classes did not do, which required the call to the unbound __init__ method of the parent.

This should solve, at least partially, issue #12 .

candale avatar Jun 18 '17 12:06 candale

I've also overridden the log method in WebService because it encoded the log line even if it was on Python3, which turned it into bytes.

candale avatar Jun 19 '17 07:06 candale

@kmike Any other observations on this PR?

candale avatar Jun 26 '17 10:06 candale

This works well for me with python3, no issues encountered

mirceachira avatar Jul 13 '17 09:07 mirceachira

Can we merge it?

mirceachira avatar Jul 13 '17 09:07 mirceachira

Hi @ChiraMircea can you guys write a test for this? It's extremely hard to reason on your code without tests.

sibiryakov avatar Jul 13 '17 16:07 sibiryakov

Hey @sibiryakov I added a few basic tests and py37 to tox, hope it's enough, please let me know if you think more tests are required.

mirceachira avatar Mar 26 '19 22:03 mirceachira