Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_event vs. read_namespaced_event #59

Closed
pfernie opened this issue Mar 17, 2017 · 4 comments
Closed

read_event vs. read_namespaced_event #59

pfernie opened this issue Mar 17, 2017 · 4 comments
Assignees
Labels
bug help wanted namespaces Issues related to namespaces support

Comments

@pfernie
Copy link
Contributor

pfernie commented Mar 17, 2017

Interleaving calls to read_event and read_namespaced_event could lead to surprising behavior (internal stack of namespaces would not be properly maintained?). It seems the Reader should always be either tracking or not tracking the namespaces, and as such should expose some configuration fn parse_namespaces(self, parse: bool) -> Self. That, or perhaps there should be separate implementations, EventReader, NamespacedEventReader, with only the latter exposing fns such as read_namespaced_event.

@pfernie pfernie mentioned this issue Mar 17, 2017
@pfernie
Copy link
Contributor Author

pfernie commented Mar 17, 2017

I added a gist showing an (admittedly pathological) usage of read_event & read_namespaced_event to illustrate.

@Mingun
Copy link
Collaborator

Mingun commented May 21, 2022

Yes, the current design of reading namespaces are not good. I'd prefer that namespace buffer would be in the Reader, because, unlike buffer for events, I cannot imagine why the user may want to clear it -- if he/she would do that, he/she lose all namespaces information and probably even breaks quick-xml.

PR for moving namespaces buffer inside Reader and always be aware of namespaces is welcome.

@Mingun Mingun added the namespaces Issues related to namespaces support label May 21, 2022
@Mingun Mingun added bug and removed enhancement labels Jun 19, 2022
@Mingun Mingun self-assigned this Jun 19, 2022
@dralley
Copy link
Collaborator

dralley commented Jul 29, 2022

@Mingun Is there any work left here or can it be closed?

@Mingun
Copy link
Collaborator

Mingun commented Jul 30, 2022

Done in #437, can be closed

@Mingun Mingun closed this as completed Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted namespaces Issues related to namespaces support
Projects
None yet
Development

No branches or pull requests

3 participants