Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mog_commons/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.10'
__version__ = '0.1.11'
2 changes: 1 addition & 1 deletion src/mog_commons/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __convert_args(args, shell, cmd_encoding):
if workaround:
return ['/bin/sh', '-c', s], False
else:
return args, shell
return s, shell

# input as list
xs = ['/bin/sh', '-c'] if workaround else []
Expand Down
5 changes: 5 additions & 0 deletions tests/mog_commons/test_command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import, unicode_literals

import os
import time
import threading
from mog_commons.command import *
Expand All @@ -13,6 +14,10 @@ def test_execute_command(self):
self.assertEqual(execute_command('exit 3', shell=True), 3)
self.assertEqual(execute_command(['/bin/sh', '-c', 'exit 4'], shell=False), 4)

with self.withAssertOutputFile(os.path.join('tests', 'resources', 'sjis_ja.txt'),
expect_file_encoding='sjis', output_encoding='sjis') as out:
execute_command('echo "あいうえお"', shell=True, cmd_encoding='sjis', stdout=out)

def test_capture_command(self):
self.assertEqual(capture_command(['echo', 'あいう'], shell=True), (0, 'あいう\n'.encode('utf-8'), b''))

Expand Down
1 change: 1 addition & 0 deletions tests/resources/sjis_ja.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����������