Skip to content
Merged
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 bandit/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def main():
)
parser.add_argument(
'-o', '--output', dest='output_file', action='store', nargs='?',
type=argparse.FileType('w'), default=sys.stdout,
type=argparse.FileType('w', encoding='utf-8'), default=sys.stdout,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The encoding parameter wasn't added until Py3.4, but we still want to support Py2.7 at this point.

https://docs.python.org/3/library/argparse.html#filetype-objects

help='write report to filename'
)
group = parser.add_mutually_exclusive_group(required=False)
Expand Down