Closed IRISDavidD closed 11 months ago
It might be that you're running code in the top level rather than only if __name__ == '__main__
. This gives an error like the one reported:
import datetime
from stream_read_xbrl import stream_read_xbrl_sync
with stream_read_xbrl_sync(datetime.date(2013, 8, 31)) as (columns, date_range_and_rows):
for ((start_date, end_date), rows) in date_range_and_rows:
print(start_date, end_date)
for row in rows:
pass
But this doesn't:
import datetime
from stream_read_xbrl import stream_read_xbrl_sync
if __name__ == '__main__':
with stream_read_xbrl_sync(datetime.date(2013, 8, 31)) as (columns, date_range_and_rows):
for ((start_date, end_date), rows) in date_range_and_rows:
print(start_date, end_date)
for row in rows:
pass
This is required due to multiprocessing behaviour that stream-read-xbrl uses under the hood.
If this doesn't solve it - can you post the code you're running, enough so we can reproduce the issue at our end? Ideally a minimum reproducible example, StackOverflow-style
This is admittedly not obvious from the docs at all - will see if can improve them.
Think this is explained by the change in docs. If no, feel free to re-open
RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.
Any idea on a fix for this?