1# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2# vim: set filetype=python:
3# This Source Code Form is subject to the terms of the Mozilla Public
4# License, v. 2.0. If a copy of the MPL was not distributed with this
5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7
8@depends("--help")
9@imports("codecs")
10@imports(_from="mozbuild.configure.util", _import="getpreferredencoding")
11@imports("os")
12@imports(_from="__builtin__", _import="open")
13def dies_when_logging(_):
14    test_file = "test.txt"
15    quote_char = "'"
16    if getpreferredencoding().lower() == "utf-8":
17        quote_char = "\u00B4"
18    try:
19        with open(test_file, "w+") as fh:
20            fh.write(quote_char)
21        out = check_cmd_output("cat", "test.txt")
22        log.info(out)
23    finally:
24        os.remove(test_file)
25