Skip to content

Commit

Permalink
fix: Custom input encoding (#601)
Browse files Browse the repository at this point in the history
The custom input specified via CLI's `-i` option did not properly detect the input encoding.  
This was fixed.

Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck authored Oct 20, 2023
1 parent 70889be commit 363934c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cyclonedx_py/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ def get_arg_parser(*, prog: Optional[str] = None) -> argparse.ArgumentParser:
)
input_method_group.add_argument(
'-i', '--in-file', action='store', metavar='FILE_PATH',
type=argparse.FileType('r'), # FileType does handle '-'
# custom input shall be treated as binary, the actual encoding is detected later
type=argparse.FileType('rb'), # FileType does handle '-'
default=None,
help='File to read input from. Use "-" to read from STDIN.', dest='input_source', required=False
)
Expand Down

0 comments on commit 363934c

Please sign in to comment.