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

AttributeError: module 'IPython.lib.pretty' has no attribute '_deferred_pprinters' with 6.83.1 #3731

Closed
jenshnielsen opened this issue Sep 4, 2023 · 1 comment · Fixed by #3730

Comments

@jenshnielsen
Copy link

With the introduction of 6.83.1 my tests have started failing in CI with:

AttributeError: module 'IPython.lib.pretty' has no attribute '_deferred_pprinters'. Did you mean: '_deferred_type_pprinters'?

This seems to have been introduced via #3728

Testing this locally with IPython 8.15.0 I see the same issue.

In [1]: import sys

In [2]: ipp = sys.modules["IPython.lib.pretty"]

In [3]: ipp._deferred_pprinters
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 ipp._deferred_pprinters

AttributeError: module 'IPython.lib.pretty' has no attribute '_deferred_pprinters'

full traceback:

self = <hypothesis.vendor.pretty.RepresentationPrinter object at 0x7fd5d77cf3a0>
output = None

    def __init__(self, output=None, *, context=None):
        """Pass the output stream, and optionally the current build context.
    
        We use the context to represent objects constructed by strategies by showing
        *how* they were constructed, and add annotations showing which parts of the
        minimal failing example can vary without changing the test result.
        """
        self.broken = False
        self.output = StringIO() if output is None else output
        self.max_width = 79
        self.max_seq_length = 1000
        self.output_width = 0
        self.buffer_width = 0
        self.buffer = deque()
    
        root_group = Group(0)
        self.group_stack = [root_group]
        self.group_queue = GroupQueue(root_group)
        self.indentation = 0
    
        self.snans = 0
    
        self.stack = []
        self.singleton_pprinters = {}
        self.type_pprinters = {}
        self.deferred_pprinters = {}
        # If IPython has been imported, load up their pretty-printer registry
        if "IPython.lib.pretty" in sys.modules:
            ipp = sys.modules["IPython.lib.pretty"]
            self.singleton_pprinters.update(ipp._singleton_pprinters)
            self.type_pprinters.update(ipp._type_pprinters)
>           self.deferred_pprinters.update(ipp._deferred_pprinters)
E           AttributeError: module 'IPython.lib.pretty' has no attribute '_deferred_pprinters'. Did you mean: '_deferred_type_pprinters'?
@Zac-HD
Copy link
Member

Zac-HD commented Sep 4, 2023

I noticed that earlier today and will fix in #3730 shortly 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants