question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSError with Python 3.8 (works with 3.6)

See original GitHub issue

Trying to run the example code for generating the Markdown table raises OSError

from pytablewriter import MarkdownTableWriter

writer = MarkdownTableWriter()
writer.table_name = "example_table"
writer.headers = ["int", "float", "str", "bool", "mix", "time"]
writer.value_matrix = [
    [0,   0.1,      "hoge", True,   0,      "2017-01-01 03:04:05+0900"],
    [2,   "-2.23",  "foo",  False,  None,   "2017-12-23 45:01:23+0900"],
    [3,   0,        "bar",  "true",  "inf", "2017-03-03 33:44:55+0900"],
    [-10, -9.9,     "",     "FALSE", "nan", "2017-01-01 00:00:00+0900"],
]

writer.write_table()
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.8/concurrent/futures/process.py", line 102, in _python_exit
    thread_wakeup.wakeup()
  File "/usr/lib/python3.8/concurrent/futures/process.py", line 90, in wakeup
    self._writer.send_bytes(b"")
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 183, in send_bytes
    self._check_closed()
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 136, in _check_closed
    raise OSError("handle is closed")
OSError: handle is closed

As seen in the traceback, I’m running Python 3.8 with pytablewriter==0.46.1. I’ve tried versions back to 0.43.0 and it didn’t help.

The example works well with Python 3.6 and pytablewriter==0.46.1. My OS is Archlinux.

Will gladly add any more info, feel free to ask.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
thombashicommented, Jan 3, 2020

@hugovk Thank you for confirmation.

@ivica-k I had added main guards to examples at documents and README. I assume the issue is now fixed.

Feel free to reopen if you still have problem.

0reactions
thombashicommented, Jul 28, 2020

In pytablewriter 0.52.0 or later, no longer need to add main guard to a program if you do not increase max_worker value equals or greater than two (defaults to one).

https://github.com/thombashi/pytablewriter/releases/tag/v0.52.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's New In Python 3.8 — Python 3.11.1 documentation
This article explains the new features in Python 3.8, compared to 3.7. Python 3.8 was released on October 14, 2019. For full details,...
Read more >
Error when installing Tensorflow - Python 3.8 - Stack Overflow
The issue is that I'm using Python 3.8 which I understand isn't supported by Tensorflow. I've downloaded Python 3.6 but I don't know...
Read more >
MATLAB Engine for Python supports Python version 2.7, 3.5 ...
We recently installed Python 3.7. · Matlab engine was working with the earlier 2.7, but now when we try installing the engine, getting...
Read more >
Using and Installing Python, Anaconda, and Jupyter
Sourcing this will add all of the paths needed to your working environment. ... Because Python 3.6 has reached end of life, Jupyter...
Read more >
Install Python 3.8, Virtual Environments using Pipenv, Django ...
2. Open Python Installer (likely in Downloads ): · Tick/Select Add Python 3.6 to PATH · Select Customize Installation (this is important) ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found