summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-07-29 17:18:47 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2016-07-29 17:18:47 -0500
commitf88fce950941e86f42927bd768cf31dc2e516cdd (patch)
tree87ba586809549fc772471de80f37bb771e59e9e2
parent20c619f649978ad99be7e43aa57e71e38d9ae9d2 (diff)
downloadflake8-bug/193.tar.gz
Open our output file in append mode alwaysbug/193
This avoid overwriting portions of our log output when using Flake8 in verbose mode. Closes #193
-rw-r--r--docs/source/release-notes/3.0.3.rst6
-rw-r--r--src/flake8/formatting/base.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/docs/source/release-notes/3.0.3.rst b/docs/source/release-notes/3.0.3.rst
index 0361879..1c23c8e 100644
--- a/docs/source/release-notes/3.0.3.rst
+++ b/docs/source/release-notes/3.0.3.rst
@@ -10,9 +10,15 @@
- Fix issue where users were unable to ignore plugin errors that were on
by default. (See also `GitLab#195`_)
+- Always open our output file in append mode so we do not overwrite log
+ messages. (See also `GitLab#193`_)
+
+
.. links
.. _GitLab#178:
https://gitlab.com/pycqa/flake8/issues/178
+.. _GitLab#193:
+ https://gitlab.com/pycqa/flake8/issues/193
.. _GitLab#195:
https://gitlab.com/pycqa/flake8/issues/195
diff --git a/src/flake8/formatting/base.py b/src/flake8/formatting/base.py
index 336bf50..97c60e1 100644
--- a/src/flake8/formatting/base.py
+++ b/src/flake8/formatting/base.py
@@ -50,7 +50,7 @@ class BaseFormatter(object):
This defaults to initializing :attr:`output_fd` if :attr:`filename`
"""
if self.filename:
- self.output_fd = open(self.filename, 'w')
+ self.output_fd = open(self.filename, 'a')
def handle(self, error):
"""Handle an error reported by Flake8.