I have this issue importing the standard random module after a full system update. A lot of packages were updated (due to openssl 1.1.0).
$this->bbcode_second_pass_code('', '
% python2
Python 2.7.13 (default, Apr 24 2017, 20:01:05)
[GCC 6.3.1 20170306] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import random
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/random.py", line 885, in <module>
_inst = Random()
File "/usr/lib/python2.7/random.py", line 97, in __init__
self.seed(x)
File "/usr/lib/python2.7/random.py", line 113, in seed
a = long(_hexlify(_urandom(2500)), 16)
OSError: [Errno 38] Function not implemented
')