summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Edmund Crosley <timothy.crosley@gmail.com>2019-03-10 21:50:32 -0700
committerGitHub <noreply@github.com>2019-03-10 21:50:32 -0700
commit5fb13577c0ddfc77f70221c65770bc9bc9b5366e (patch)
tree3a215f19440a80b34fe3a76bc45770fe824c68f1
parent82cfcb00153d598e4e84c6ebda8bb88b61457ddd (diff)
parent2408e2ec90d3ba0a4b239ddf901c4febb0800be3 (diff)
downloadisort-5fb13577c0ddfc77f70221c65770bc9bc9b5366e.tar.gz
Merge pull request #896 from timothycrosley/feature/fix-issue-895
Feature/fix issue 895
-rw-r--r--CHANGELOG.md3
-rw-r--r--isort/isort.py8
2 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c3e3d567..66e88cc1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
Changelog
=========
+### 4.3.15 - March 10, 2019 - hot fix release
+- Fixed a regression with handling streaming input from pipes (Issue #895)
+
### 4.3.14 - March 9, 2019 - hot fix release
- Fixed a regression with */directory/*.py style patterns
diff --git a/isort/isort.py b/isort/isort.py
index 7d971b47..ac21230f 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -136,8 +136,12 @@ class SortImports(object):
self.file_encoding,
file_to_import_sort.encoding))
elif file_:
- self.file_encoding = coding_check(file_)
- file_.seek(0)
+ try:
+ file_.seek(0)
+ self.file_encoding = coding_check(file_)
+ file_.seek(0)
+ except io.UnsupportedOperation:
+ pass
reader = codecs.getreader(self.file_encoding)
file_contents = reader(file_).read()