irmen / Pyro5

Pyro 5 - Python remote objects
https://pyro5.readthedocs.io
MIT License
303 stars 36 forks source link

Type replacement fallback bypasses registered classes registry #48

Open eudoxos opened 3 years ago

eudoxos commented 3 years ago

This bit:

https://github.com/irmen/Pyro5/blob/0f09262d4bd3957db3fa0d3ce3efbe7390093aed/Pyro5/serializers.py#L291-L297

will not call special serializers created via Pyro5.api.register_class_to_dict. I sense there must be some reason for that. What is it?

Context: I am hitting a case where Pyro5 creates type replacement for an exposed class (autoproxying). When another instance of that class is not registered, the object itself is returned. Now, in such case, I would to use register_class_to_dict to do automatic daemon registration, but it is not getting called as ser_default_class is called directly.

irmen commented 3 years ago

I don't know :) It's been quite a while since I did something with autoproxied classes. Will have to dig into these specifics again to be able to give a good answer.

irmen commented 2 years ago

@eudoxos can you provide a snippet of code that demonstrates the problem?

eudoxos commented 2 years ago

I cannot even understand my own description now... sorry. If I bump into that again, I will remember.