Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymilter-suspicious-from
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
misc
pymilter-suspicious-from
Commits
9846cc33
Commit
9846cc33
authored
5 years ago
by
Jan Philipp Timme
Browse files
Options
Downloads
Patches
Plain Diff
Different approach to handling encoding/decoding errors
parent
0aa8dbb8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+2
-2
2 additions, 2 deletions
main.py
with
2 additions
and
2 deletions
main.py
+
2
−
2
View file @
9846cc33
...
@@ -32,9 +32,9 @@ def get_decoded_header(value):
...
@@ -32,9 +32,9 @@ def get_decoded_header(value):
decoded_header_items
=
decode_header
(
value
)
decoded_header_items
=
decode_header
(
value
)
decoded_header_value
=
''
decoded_header_value
=
''
for
item
in
decoded_header_items
:
for
item
in
decoded_header_items
:
decoded_item
=
item
[
0
].
decode
(
item
[
1
],
'
replac
e
'
)
if
item
[
1
]
is
not
None
else
item
[
0
]
decoded_item
=
item
[
0
].
decode
(
item
[
1
],
'
ignor
e
'
)
if
item
[
1
]
is
not
None
else
item
[
0
]
if
isinstance
(
decoded_item
,
bytes
):
if
isinstance
(
decoded_item
,
bytes
):
decoded_item
=
decoded_item
.
decode
(
'
ascii
'
,
'
replac
e
'
)
decoded_item
=
decoded_item
.
decode
(
'
ascii
'
,
'
ignor
e
'
)
decoded_header_value
+=
decoded_item
decoded_header_value
+=
decoded_item
return
decoded_header_value
return
decoded_header_value
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment