* Added `from __future__ import unicode_literals` to every file so
now all strings in code are forced to be unicode strings unless
marked as byte string `b'str'` or encoded to byte string `'str'.encode('utf-8')`.
This is a large change but we have been working towards the goal of unicode
strings passed in the code so decoding external input and encoding
output as byte strings (where applicable).
Note that in Python 2 the `str` type still refers to byte strings.
* Replaced the use of `str` for `basestring` in isinstance comparison as
this was the original intention but breaks code when encoutering unicode strings.
* Marked byte strings in gtkui as the conversion to utf8 is not always handled, mostly
related to gobject signal names.
15 lines
465 B
Python
15 lines
465 B
Python
# Increase open file descriptor limit to allow tests to run
|
|
# without getting error: what(): epoll: Too many open files
|
|
from __future__ import print_function, unicode_literals
|
|
|
|
try:
|
|
import resource
|
|
except ImportError: # Does not exist on Windows
|
|
pass
|
|
else:
|
|
try:
|
|
resource.setrlimit(resource.RLIMIT_NOFILE, (65536, 65536))
|
|
except (ValueError, resource.error) as ex:
|
|
# print('Failed to raise file descriptor limit:', ex)
|
|
pass
|