Page MenuHomeSoftware Heritage

web app: empty lines in text files displayed as "{1}"
Closed, MigratedEdits Locked

Description

Event Timeline

davidak created this object in space S1 Public.
zack triaged this task as Normal priority.Sep 23 2018, 8:10 AM
zack added a project: Web app.
zack added a subscriber: zack.

definitely a bug, thanks for reporting!

zack renamed this task from empty lines displayed as "{1}" to web app: empty lines in text files displayed as "{1}".Sep 23 2018, 8:10 AM

Hello,

Are you altering the source code?

No, we are not ;)
The goal is to preserve, collect and share (as is) [1]

To be sure (for at least the example you provided), you can from the ui, click on the raw file button, that will display you the raw file.
You will no longer see those {1}.

If it's not enough to reassure you, you can also compute the original sha256 (or any other checksums we provide, click on actions > show metadata > lookup sha256).
And then compare that with the original file.

Retrieve the original file from github:

$ git clone https://github.com/davidak/PyZufall/
Cloning into 'PyZufall'...
remote: Enumerating objects: 1469, done.
remote: Counting objects: 100% (1469/1469), done.
remote: Compressing objects: 100% (566/566), done.
remote: Total 1469 (delta 879), reused 1469 (delta 879), pack-reused 0
Receiving objects: 100% (1469/1469), 7.41 MiB | 143.00 KiB/s, done.
Resolving deltas: 100% (879/879), done.
$ sha256sum pyzufall/satz.py
bcfe480d1544ed6460abcbf29d07ed95b7e2f0336d96f381431d459f41c1c9bb  pyzufall/satz.py
$ echo bcfe480d1544ed6460abcbf29d07ed95b7e2f0336d96f381431d459f41c1c9bb  # from swh's ui
bcfe480d1544ed6460abcbf29d07ed95b7e2f0336d96f381431d459f41c1c9bb
  1. Going a little further, retrieve the file from us and compute away, for example:
# url is coming from the raw button i mentioned
$ curl https://archive.softwareheritage.org/browse/content/sha1_git:69182fb6809e4f6a064ecfdabb3a3c2269e2f0ea/raw/\?filename\=satz.py  > satz.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16050  100 16050    0     0  43495      0 --:--:-- --:--:-- --:--:-- 43495
$ sha256sum satz.py
bcfe480d1544ed6460abcbf29d07ed95b7e2f0336d96f381431d459f41c1c9bb  satz.py

Everything matches.

So that's definitely a problem on the front part ;)

Thanks for your report.

[1] https://www.softwareheritage.org/mission/

Cheers,

@ardumont thanks for your response.

I know your mission and love it! It shouldn't sound like you intend to altering the code in a malicious way, just the question if it's just displayed wrong or if the code is saved this way by accident. The latter would be a huge issue and you would probably have to download everything again. So this is good news. Thanks for analyzing the situation!

After a quick investigation, the issue comes from the js library we are using to add line numbers to the highlighted code.
The issue is known upstream but currently not fixed: https://github.com/wcoder/highlightjs-line-numbers.js/issues/42.
I will update this Github issue by reporting the error we got.