#4907 Python file in repo downloads HTML instead of displaying the content
Closed: Fixed 3 years ago by pingou. Opened 3 years ago by churchyard.

I use Chromium.

When I go to https://src.fedoraproject.org/fork/churchyard/rpms/python-setuptools/tree/check_vendored_python and click bundled_provides.py, my browser downloads the file, but it's a HTML file:

<!DOCTYPE html>
<html lang='en'>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>Tree - rpms/python-setuptools - src.fedoraproject.org</title>
        <link rel="shortcut icon" type="image/vnd.microsoft.icon"
        href="/theme/static/favicon.ico?version=5.10.0"/>
    <link href="/theme/static/fedora-bootstrap-1.3.0/fedora-bootstrap.min.css?version=5.10.0"
        type="text/css" rel="stylesheet" />
    <link href="/theme/static/fonts/fonts.css?version=5.10.0"
        rel="stylesheet" type="text/css" />
    <link href="/theme/static/fonts/hack_fonts/css/hack-extended.min.css?version=5.10.0"
        type="text/css" rel="stylesheet" />
    <link href="/theme/static/theme.css?version=5.10.0"
        type="text/css" rel="stylesheet" />

    <link type="text/css" rel="stylesheet" nonce="2QNmpeB2ONPq6ebCTHMOCa1XO" href="/static/vendor/font-awesome/font-awesome.css?version=5.10.0"/>
    <link type="text/css" rel="stylesheet" nonce="2QNmpeB2ONPq6ebCTHMOCa1XO" href="/static/pagure.css?version=5.10.0"/>
<link nonce="2QNmpeB2ONPq6ebCTHMOCa1XO" rel="stylesheet" href="/static/vendor/highlight.js/styles/github.css?version=5.10.0"/>
<link nonce="2QNmpeB2ONPq6ebCTHMOCa1XO" rel="stylesheet" href="/static/vendor/highlightjs-line-numbers/highlightjs-line-numbers.min.css?version=5.10.0"/>
<style nonce="2QNmpeB2ONPq6ebCTHMOCa1XO">
  .hljs {
    background: #fff;
  }
</style>
  </head>
...

I would expect to see the file content, like with other files there.


Metadata Update from @pingou:
- Issue tagged with: bug

3 years ago

Metadata Update from @pingou:
- Issue assigned to pingou

3 years ago

I was able to reproduce this locally and the root cause is that pagure is not able to figure out the encoding of the file.

That being said, in those situation, it should return the raw file, not the html page and that's something we can easily address.

Metadata Update from @pingou:
- Issue set to the milestone: 5.12

3 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #4964 Merged 3 years ago