Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-web
Commits
4372d376
Commit
4372d376
authored
1 year ago
by
Antoine Lambert
Browse files
Options
Downloads
Patches
Plain Diff
browse/utils: Remove redundant isinstance call
parent
458ad280
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#8280
passed
1 year ago
Stage: external
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/web/browse/utils.py
+0
-1
0 additions, 1 deletion
swh/web/browse/utils.py
with
0 additions
and
1 deletion
swh/web/browse/utils.py
+
0
−
1
View file @
4372d376
...
...
@@ -109,7 +109,6 @@ def re_encode_content(
if
mimetype
.
startswith
(
"
text/
"
)
and
encoding
not
in
(
"
us-ascii
"
,
"
utf-8
"
):
# first check if charset_normalizer detects an encoding with confidence
result
=
charset_normalizer
.
detect
(
content_data
)
assert
isinstance
(
result
[
"
confidence
"
],
float
)
if
cast
(
float
,
result
[
"
confidence
"
])
>=
0.9
:
encoding
=
cast
(
str
,
result
[
"
encoding
"
])
content_data
=
content_data
.
decode
(
encoding
,
"
replace
"
).
encode
(
"
utf-8
"
)
...
...
This diff is collapsed.
Click to expand it.
Antoine Lambert
@anlambert
mentioned in merge request
!1264 (merged)
·
1 year ago
mentioned in merge request
!1264 (merged)
mentioned in merge request !1264
Toggle commit list
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