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

Custom __dir__ in 1.20.0 breaks when called on 'Message' instead of subclass #296

Closed
saggitar opened this issue Feb 12, 2022 · 1 comment · Fixed by #302
Closed

Custom __dir__ in 1.20.0 breaks when called on 'Message' instead of subclass #296

saggitar opened this issue Feb 12, 2022 · 1 comment · Fixed by #302
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@saggitar
Copy link

saggitar commented Feb 12, 2022

Environment details

  • Programming language: Python
  • OS: Arch Linux (Kernel: Linux 5.16.5-arch1-1, Architecture: x86-64)
  • Language runtime version: tested with 3.8, 3.9, 3.10
  • Package version: 1.20.0

Steps to reproduce

  1. Install new proto-plus version
  2. >>> import proto.message
    >>> dir(proto.message.Message)
    [...]
    AttributeError: type object 'Message' has no attribute '_meta'
    

_meta is only set when new proto.message.Message types are created, so __dir__ does not work on
proto.message.Message itself.
In this case __dir__ should probably fall back to object.__dir__ as it was implicitly the case in previous versions.

@saggitar saggitar added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 12, 2022
@software-dov
Copy link
Contributor

This is my bad, fix is imminent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants