Skip to content

Conversation

@SaurabhCodesAI
Copy link
Contributor

@SaurabhCodesAI SaurabhCodesAI commented Oct 17, 2025

Fixes

Description

This pull request fixes crashes found while testing the scripts:

  • scripts/shared.py crashed with an IndexError when processing certain README files.
  • scripts/plot.py had an issue with color cycling that caused index errors.
  • scripts/1-fetch/gcs_fetch.py retry loop could get stuck on some HTTP errors.

Technical details

  • Added bounds checking in shared.py to avoid IndexError when parsing README files.
  • Corrected color cycling logic in plot.py to prevent index errors.
  • Improved retry loop in gcs_fetch.py to avoid infinite retries on non retryable HTTP errors.

Tests

To verify:

  1. Run the affected scripts with problematic input (README files with missing sections, data that triggers color cycling, and simulate HTTP errors).
  2. Confirm that no IndexError or infinite retry occurs.
  3. Check that the scripts complete successfully and produce expected output.

Screenshots

Checklist

  • I have read and understood the Developer Certificate of Origin (DCO), below, which covers the contents of this pull request (PR).
  • My pull request doesn't include code or content generated with AI.
  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main or master).
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@SaurabhCodesAI SaurabhCodesAI requested review from a team as code owners October 17, 2025 23:50
@SaurabhCodesAI SaurabhCodesAI requested review from Shafiya-Heena and TimidRobot and removed request for a team October 17, 2025 23:50
@TimidRobot
Copy link
Member

‼️ To repeat myself (#197 (comment)):

@SaurabhCodesAI This pull request (PR) is unacceptable due to a failure to follow the PR template instructions.

@TimidRobot TimidRobot self-assigned this Oct 20, 2025
@SaurabhCodesAI
Copy link
Contributor Author

@TimidRobot Sorry about missing the template again, and thanks for your patience. I appreciate you holding the bar high, I’ll update the PR to follow the template and re request review. If there’s anything else you’d like, just let me know!

@SaurabhCodesAI
Copy link
Contributor Author

SaurabhCodesAI commented Oct 20, 2025

@TimidRobot I’ve made the changes and updated the PR description to match the template. Could you please take another look and let me know if anything else is needed? Thanks!

@TimidRobot
Copy link
Member

TimidRobot commented Oct 20, 2025

@TimidRobot I’ve made the changes and updated the PR description to match the template. Could you please take another look and let me know if anything else is needed? Thanks!

‼️‼️ To repeat myself (#202 (comment)):

‼️ To repeat myself (#197 (comment)):

@SaurabhCodesAI This pull request (PR) is unacceptable due to a failure to follow the PR template instructions.

The Checklist instructions include:

<!-- DON'T remove this section or any of the lines. -->
<!-- Leave incomplete or inapplicable lines unchecked. -->
<!-- Replace the [ ] with [x] to check the boxes (there is no space between x and square brackets). -->

The template is located here: creativecommons/.github/blob/main/.github/PULL_REQUEST_TEMPLATE.md

Pull requests without the Developer Certificate of Origin section won't be accepted 🙅🏻

@SaurabhCodesAI
Copy link
Contributor Author

@TimidRobot Sorry for the repeated mistakes. I’ve carefully updated the PR to match the template. i will pay more attention to structured way of contributinng to opensource from now on. does this update match the things you were reminding me of?

@TimidRobot
Copy link
Member

@TimidRobot Sorry for the repeated mistakes. I’ve carefully updated the PR to match the template. i will pay more attention to structured way of contributinng to opensource from now on. does this update match the things you were reminding me of?

Yes, the description looks much better now. Thank you.

Copy link
Member

@TimidRobot TimidRobot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for identifying and fixing these issues

@TimidRobot TimidRobot merged commit ee9d97c into creativecommons:main Oct 21, 2025
@github-project-automation github-project-automation bot moved this from In review to Done in TimidRobot Oct 21, 2025
@SaurabhCodesAI
Copy link
Contributor Author

@TimidRobot Thanks so much for your help and guidance throughout this process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fixed crashes in shared.py and plot.py

2 participants