Skip to content

RSS doesn't seem to work anymore? #2406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jackenmen opened this issue Mar 10, 2022 · 7 comments · Fixed by #2413
Closed

RSS doesn't seem to work anymore? #2406

Jackenmen opened this issue Mar 10, 2022 · 7 comments · Fixed by #2413
Labels
bug infra Core infrastructure for building and rendering PEPs

Comments

@Jackenmen
Copy link
Contributor

I imagine that this is due to the recent change in PEPs infrastructure.
There is no information about specific PEPs here but lastBuildDate changes:
Screenshot_20220310-093645_Chrome.jpg

@hugovk
Copy link
Member

hugovk commented Mar 10, 2022

For reference https://peps.python.org/peps.rss shows only:

<?xml version='1.0' encoding='UTF-8'?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Newest Python PEPs</title>
    <link>https://peps.python.org/peps.rss</link>
    <description>Newest Python Enhancement Proposals (PEPs) - Information on new language features, and some meta-information like release procedure and schedules.</description>
    <atom:link href="https://peps.python.org/peps.rss" rel="self"/>
    <docs>https://cyber.harvard.edu/rss/rss.html</docs>
    <language>en</language>
    <lastBuildDate>Thu, 10 Mar 2022 08:28:04 GMT</lastBuildDate>
  </channel>
</rss>

@Jackenmen
Copy link
Contributor Author

Oh ye, this is what I've shown on the screenshot, I should have copied that instead, thanks!

@CAM-Gerlach CAM-Gerlach added bug infra Core infrastructure for building and rendering PEPs labels Mar 10, 2022
@hugovk
Copy link
Member

hugovk commented Mar 10, 2022

I would prioritise fixing this in the new PEP build system.


A quick look: the main problem is in generate_rss.py:

def main():
    # get the directory with the PEP sources
    out_dir = Path(__file__).parent / "build"

    # get list of peps with creation time (from "Created:" string in pep source)
    peps_with_dt = sorted((pep_creation(path), path) for path in out_dir.glob("pep-????.*"))

peps_with_dt is empty because there pep-????.*" matches no files in build/; it now contains directories of files like build/pep-0008/index.html.

It's also expecting to run on source rst/txt files containing Created: lines, not target html files like:

<dt class="field-even">Created</dt>
<dd class="field-even">05-Jul-2001</dd>

(Also, make pages runs make rss before generating the target html files, so build is actually empty, but it's expecting source rst/txt files.)

@CAM-Gerlach
Copy link
Member

I've also been noticing a bunch of error messages (at least on the CI) when running it related to stuff it can't parse, but I'm not sure if those have anything to do with the problem reported here.

@hugovk
Copy link
Member

hugovk commented Mar 10, 2022

Please see PR #2407 for a fix.

I've also been noticing a bunch of error messages (at least on the CI) when running it related to stuff it can't parse, but I'm not sure if those have anything to do with the problem reported here.

Like this?

$ python3 generate_rss.py
<rst-doc>:556: (ERROR/3) PEP number must be a number from 0 to 9999; "PEP 586 mentions
<586#backwards-compatibility>" is invalid.
<rst-doc>:4: (ERROR/3) Unexpected indentation.
<rst-doc>:5: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
<rst-doc>:195: (ERROR/3) PEP number must be a number from 0 to 9999; "PEP 557 <557#id7>" is invalid.
<rst-doc>:527: (ERROR/3) PEP number must be a number from 0 to 9999; "557 <557#inheritance>" is invalid.
<rst-doc>:532: (ERROR/3) PEP number must be a number from 0 to 9999; "PEP 557 indicates <557#post-init-parameters>" is invalid.
<rst-doc>:4: (ERROR/3) Unexpected indentation.
<rst-doc>:5: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
<rst-doc>:1202: (ERROR/3) PEP number must be a number from 0 to 9999; "PEP 484 specifies
<484#suggested-syntax-for-python-2-7-and-straddling-code>" is invalid.

Same stuff with the old one:

$ python3 pep2rss.py .
<rst-doc>:4: (ERROR/3) Unexpected indentation.
<rst-doc>:5: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
<rst-doc>:1202: (ERROR/3) PEP number must be a number from 0 to 9999; "PEP 484 specifies
<484#suggested-syntax-for-python-2-7-and-straddling-code>" is invalid.
<rst-doc>:4: (ERROR/3) Unexpected indentation.
<rst-doc>:5: (WARNING/2) Block quote ends without a blank line; unexpected unindent.
<rst-doc>:195: (ERROR/3) PEP number must be a number from 0 to 9999; "PEP 557 <557#id7>" is invalid.
<rst-doc>:527: (ERROR/3) PEP number must be a number from 0 to 9999; "557 <557#inheritance>" is invalid.
<rst-doc>:532: (ERROR/3) PEP number must be a number from 0 to 9999; "PEP 557 indicates <557#post-init-parameters>" is invalid.
<rst-doc>:556: (ERROR/3) PEP number must be a number from 0 to 9999; "PEP 586 mentions
<586#backwards-compatibility>" is invalid.

@CAM-Gerlach
Copy link
Member

I see, thanks, so its not a regression. Should we open another issue for that?

@hugovk
Copy link
Member

hugovk commented Mar 11, 2022

Sure! It's coming from the docutils RST parser; some warnings/errors may be invalid, but some might be things to fix in our code or the PEPs themselves. (I'm not sure if Sphinx uses the same parser.)

Also, we're parsing the 10 most recent PEPs here, which will change over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug infra Core infrastructure for building and rendering PEPs
Projects
None yet
3 participants