mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Fix stdout and stderr wrappers
Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Updated ``requirementslib`` to aid in resolution of local and remote archives.
|
||||
+6
-4
@@ -28,10 +28,12 @@ if sys.version_info >= (3, 1) and sys.version_info <= (3, 6):
|
||||
if sys.stdout.isatty() and sys.stderr.isatty():
|
||||
import io
|
||||
import atexit
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf8')
|
||||
atexit.register(sys.stdout.close)
|
||||
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf8')
|
||||
atexit.register(sys.stdout.close)
|
||||
stdout_wrapper = io.TextIOWrapper(sys.stdout.buffer, encoding='utf8')
|
||||
atexit.register(stdout_wrapper.close)
|
||||
stderr_wrapper = io.TextIOWrapper(sys.stderr.buffer, encoding='utf8')
|
||||
atexit.register(stderr_wrapper.close)
|
||||
sys.stdout = stdout_wrapper
|
||||
sys.stderr = stderr_wrapper
|
||||
|
||||
os.environ["PIP_DISABLE_PIP_VERSION_CHECK"] = fs_str("1")
|
||||
|
||||
|
||||
+8
-3
@@ -99,8 +99,13 @@ def main():
|
||||
import io
|
||||
import six
|
||||
if six.PY3:
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
|
||||
sys.stderr = io.TextIOWrapper(sys.stderr.buffer,encoding='utf8')
|
||||
import atexit
|
||||
stdout_wrapper = io.TextIOWrapper(sys.stdout.buffer, encoding='utf8')
|
||||
atexit.register(stdout_wrapper.close)
|
||||
stderr_wrapper = io.TextIOWrapper(sys.stderr.buffer, encoding='utf8')
|
||||
atexit.register(stderr_wrapper.close)
|
||||
sys.stdout = stdout_wrapper
|
||||
sys.stderr = stderr_wrapper
|
||||
else:
|
||||
from pipenv._compat import force_encoding
|
||||
force_encoding()
|
||||
@@ -111,7 +116,7 @@ def main():
|
||||
# sys.argv = remaining
|
||||
parsed = handle_parsed_args(parsed)
|
||||
_main(parsed.pre, parsed.clear, parsed.verbose, parsed.system,
|
||||
parsed.requirements_dir, parsed.packages)
|
||||
parsed.requirements_dir, parsed.packages)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user