dgunning / edgartools

Python library for working with SEC Edgar
MIT License
324 stars 70 forks source link

Bug: filings.get(accession_no) throws: LiveError: Only one live display may be active at once #24

Closed davelacy closed 6 months ago

davelacy commented 6 months ago

This one is quite strange and may be related to https://github.com/dgunning/edgartools/issues/20

It looks like only NEW filings are throwing this error, though I have not yet confirmed. When taking one of the most recent filing accession numbers from https://www.sec.gov/cgi-bin/browse-edgar?company=&CIK=&type=8-K&owner=include&count=100&action=getcurrent&start=2 and passing it to find the following error is thrown:

accession_no = '0001493152-24-001619'
f = find(accession_no)
           WARNING                                                                                                        _filings.py:626
                        Provide a year between 1994 and 2024 and optionally a quarter (1-4) for which the SEC has                        
                    filings.                                                                                   
                            e.g. filings = get_filings(2023) OR                                                                          
                                 filings = get_filings(2023, 1)                                                
                        (You specified the year 2024 and quarter 2)                                            
           WARNING                                                                                                        _filings.py:626
                        Provide a year between 1994 and 2024 and optionally a quarter (1-4) for which the SEC has                        
                    filings.                                                                                   
                            e.g. filings = get_filings(2023) OR                                                                          
                                 filings = get_filings(2023, 1)                                                
                        (You specified the year 2024 and quarter 3)                                            
           WARNING                                                                                                        _filings.py:626
                        Provide a year between 1994 and 2024 and optionally a quarter (1-4) for which the SEC has                        
                    filings.                                                                                   
                            e.g. filings = get_filings(2023) OR                                                                          
                                 filings = get_filings(2023, 1)                                                
                        (You specified the year 2024 and quarter 4)                                            
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/blahblah/python3.11/site-packages/edgar/__init__.py", line 77, in find
    return get_by_accession_number(search_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/blahblah/python3.11/site-packages/edgar/_filings.py", line 2050, in get_by_accession_number
    return filings.get(accession_number)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/blahblah/python3.11/site-packages/edgar/_filings.py", line 812, in get
    with Status(f"[bold deep_sky_blue1]Searching through the most recent filings for {accession_number}...",
  File "/blahblah/python3.11/site-packages/rich/status.py", line 97, in __enter__
    self.start()
  File "/blahblah/python3.11/site-packages/rich/status.py", line 87, in start
    self._live.start()
  File "/blahblah/python3.11/site-packages/rich/live.py", line 113, in start
    self.console.set_live(self)
  File "/blahblah/python3.11/site-packages/rich/console.py", line 836, in set_live
    raise errors.LiveError("Only one live display may be active at once")
rich.errors.LiveError: Only one live display may be active at once
>>> 

and if attempted again...

>>> f = find('0001493152-24-001619')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/blahblah/python3.11/site-packages/edgar/__init__.py", line 77, in find
    return get_by_accession_number(search_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/blahblah/python3.11/site-packages/edgar/_filings.py", line 2050, in get_by_accession_number
    return filings.get(accession_number)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/blahblah/python3.11/site-packages/edgar/_filings.py", line 812, in get
    with Status(f"[bold deep_sky_blue1]Searching through the most recent filings for {accession_number}...",
  File "/blahblah/python3.11/site-packages/rich/status.py", line 97, in __enter__
    self.start()
  File "/blahblah/python3.11/site-packages/rich/status.py", line 87, in start
    self._live.start()
  File "/blahblah/python3.11/site-packages/rich/live.py", line 113, in start
    self.console.set_live(self)
  File "/blahblah/python3.11/site-packages/rich/console.py", line 836, in set_live
    raise errors.LiveError("Only one live display may be active at once")
rich.errors.LiveError: Only one live display may be active at once
dgunning commented 6 months ago

Taking a look. Will probably fix by tomorrow or Sunday. Thanks

dgunning commented 6 months ago

Fixed in release 2.6.5

davelacy commented 6 months ago

Awesome thanks @dgunning for the quick turnaround!