Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Issue with CRLF in sites.yaml #45

Open
loviuz opened this issue Jan 2, 2021 · 1 comment
Open

Issue with CRLF in sites.yaml #45

loviuz opened this issue Jan 2, 2021 · 1 comment

Comments

@loviuz
Copy link

loviuz commented Jan 2, 2021

Hi, i have added this source to sites.yaml:

PortSwigger:
  filter: null
  github: null
  latest_article: US court order brings down the shutters on tech support scheme impacting
    the elderly
  tags:
  - english
  - hacking
  url: https://portswigger.net/daily-swig/rss

On "latest_article:" the title has been saved with carriage return, so I think the next time the download will occur I will get an error :-/

@Findus23
Copy link
Owner

Findus23 commented Jan 2, 2021

Hi,

Indeed for me it also prints the latest_article with a newline. But I think it is valid YAML and it works for me on the next run.

You can easily see this by running this simple program:

import json
import yaml

with open("sites.yaml") as f:
    data = yaml.safe_load(f)
    print(json.dumps(data, indent=2))

Thanks to the indent it is again read properly as one string:

{
  "PortSwigger": {
    "github": null,
    "latest_article": "US court order brings down the shutters on tech support scheme impacting the elderly",
    "tags": [
      "english",
      "hacking"
    ],
    "url": "https://portswigger.net/daily-swig/rss"
  }
}

Do you use the latest version of pyyaml (5.3.1)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants