Skip to content Skip to sidebar Skip to footer

Attributeerror: __exit__ With Socketserver On Python-3.4.3

I have two systems A Mac system running python 3.6.3 A linux (ubuntu 14.04) sytem running python 3.4.3 I've been testing the following code segment on both systems to try and ide

Solution 1:

socketserver servers don't support use as context managers before Python 3.6. Quoting the docs:

Changed in version 3.6: Support for the context manager protocol was added. Exiting the context manager is equivalent to calling server_close().

In the future, if different Python versions are behaving differently, you should check the docs to look for documented version differences.

Post a Comment for "Attributeerror: __exit__ With Socketserver On Python-3.4.3"