diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..8d996bfc --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,27 @@ +build: false + +environment: + matrix: + - PYTHON: "C:\\Python36-x64" + PYTHON_VERSION: "3.6.x" + PYTHON_ARCH: "64" + + - PYTHON: "C:\\Python34-x64" + PYTHON_VERSION: "3.4.x" + PYTHON_ARCH: "32" + + - PYTHON: "C:\\Python27-x64" + PYTHON_VERSION: "2.7.x" + PYTHON_ARCH: "64" + +init: + - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%" + +install: + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" + - "%CMD_IN_ENV% pip install --upgrade setuptools pip" + - "%CMD_IN_ENV% pip install .[test]" + - "%CMD_IN_ENV% mkdir results" + - "%CMD_IN_ENV% cd results" +test_script: + - "%CMD_IN_ENV% pytest --pyargs -v traitlets" diff --git a/traitlets/config/loader.py b/traitlets/config/loader.py index 68c0b68f..27345241 100644 --- a/traitlets/config/loader.py +++ b/traitlets/config/loader.py @@ -16,7 +16,7 @@ from ipython_genutils.path import filefind from ipython_genutils import py3compat from ipython_genutils.encoding import DEFAULT_ENCODING -from six import text_type, string_types +from six import text_type, string_types, PY3 from traitlets.traitlets import ( HasTraits, Container, List, Dict, Any, ) @@ -492,8 +492,12 @@ def get_config(): get_config=get_config, __file__=self.full_filename, ) - fs_encoding = sys.getfilesystemencoding() or 'ascii' - conf_filename = self.full_filename.encode(fs_encoding) + # encode filename to bytes only on py2 on non-Windows: + if PY3 or sys.platform.startswith('win'): + conf_filename = self.full_filename + else: + fs_encoding = sys.getfilesystemencoding() or 'ascii' + conf_filename = self.full_filename.encode(fs_encoding) py3compat.execfile(conf_filename, namespace)