Show More
@@ -285,7 +285,8 b' class PyFileConfigLoader(FileConfigLoader):' | |||
|
285 | 285 | return self.config |
|
286 | 286 | |
|
287 | 287 | namespace = dict(load_subconfig=load_subconfig, get_config=get_config) |
|
288 |
|
|
|
288 | fs_encoding = sys.getfilesystemencoding() or 'ascii' | |
|
289 | conf_filename = self.full_filename.encode(fs_encoding) | |
|
289 | 290 | execfile(conf_filename, namespace) |
|
290 | 291 | |
|
291 | 292 | def _convert_to_config(self): |
@@ -362,6 +362,10 b' class Application(object):' | |||
|
362 | 362 | This tries to load the config file from disk. If successful, the |
|
363 | 363 | ``CONFIG_FILE`` config variable is set to the resolved config file |
|
364 | 364 | location. If not successful, an empty config is used. |
|
365 | ||
|
366 | By default, errors in loading config are handled, and a warning | |
|
367 | printed on screen. For testing, the suppress_errors option is set | |
|
368 | to False, so errors will make tests fail. | |
|
365 | 369 | """ |
|
366 | 370 | self.log.debug("Attempting to load config file: %s" % |
|
367 | 371 | self.config_file_name) |
@@ -16,6 +16,7 b' from __future__ import print_function' | |||
|
16 | 16 | |
|
17 | 17 | # Stdlib imports |
|
18 | 18 | import linecache |
|
19 | import sys | |
|
19 | 20 | |
|
20 | 21 | # Third-party imports |
|
21 | 22 | import nose.tools as nt |
@@ -47,10 +48,12 b' def test_compiler():' | |||
|
47 | 48 | cp('x=1', 'single') |
|
48 | 49 | nt.assert_true(len(linecache.cache) > ncache) |
|
49 | 50 | |
|
50 | def test_compiler_unicode(): | |
|
51 | import sys | |
|
51 | def setUp(): | |
|
52 | # Check we're in a proper Python 2 environment (some imports, such | |
|
53 | # as GTK, can change the default encoding, which can hide bugs.) | |
|
52 | 54 | nt.assert_equal(sys.getdefaultencoding(), "ascii") |
|
53 | ||
|
55 | ||
|
56 | def test_compiler_unicode(): | |
|
54 | 57 | cp = compilerop.CachingCompiler() |
|
55 | 58 | ncache = len(linecache.cache) |
|
56 | 59 | cp(u"t = 'žćčšđ'", "single") |
@@ -17,8 +17,10 b' import nose.tools as nt' | |||
|
17 | 17 | from IPython.utils.tempdir import TemporaryDirectory |
|
18 | 18 | from IPython.core.history import HistoryManager, extract_hist_ranges |
|
19 | 19 | |
|
20 | def test_history(): | |
|
20 | def setUp(): | |
|
21 | 21 | nt.assert_equal(sys.getdefaultencoding(), "ascii") |
|
22 | ||
|
23 | def test_history(): | |
|
22 | 24 | ip = get_ipython() |
|
23 | 25 | with TemporaryDirectory() as tmpdir: |
|
24 | 26 | #tmpdir = '/software/temp' |
@@ -168,6 +168,10 b' def make_exclude():' | |||
|
168 | 168 | |
|
169 | 169 | if not have['wx']: |
|
170 | 170 | exclusions.append(ipjoin('lib', 'inputhookwx')) |
|
171 | ||
|
172 | # We do this unconditionally, so that the test suite doesn't import | |
|
173 | # gtk, changing the default encoding and masking some unicode bugs. | |
|
174 | exclusions.append(ipjoin('lib', 'inputhookgtk')) | |
|
171 | 175 | |
|
172 | 176 | # These have to be skipped on win32 because the use echo, rm, cd, etc. |
|
173 | 177 | # See ticket https://bugs.launchpad.net/bugs/366982 |
General Comments 0
You need to be logged in to leave comments.
Login now