test_runpy.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:zippy 作者: securesystemslab 项目源码 文件源码
def test_encoding(self):
        with temp_dir() as script_dir:
            filename = os.path.join(script_dir, 'script.py')
            with open(filename, 'w', encoding='latin1') as f:
                f.write("""
#coding:latin1
"non-ASCII: h\xe9"
""")
            result = run_path(filename)
            self.assertEqual(result['__doc__'], "non-ASCII: h\xe9")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号