openzim / ted

Provide the best of TED.com for offline usage!
https://download.kiwix.org/zim/ted/
GNU General Public License v3.0
13 stars 9 forks source link

fix issue with sort_language_hack returning None #175

Closed elfkuzco closed 6 months ago

elfkuzco commented 6 months ago

Rationale

When run with --languages flag, the scraper throws an error

 self.zim_languages = ",".join(
                         ^^^^^^^^^
TypeError: can only join an iterable

This is because the list.sort method returns None as it sorts the list in place.

            return list(languages).sort(
                key=lambda x: -1 if x == "eng" else 0
            )  # pyright: ignore[reportReturnType]

Changes

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 0.00%. Comparing base (d57d160) to head (de6ad9e).

Files Patch % Lines
src/ted2zim/scraper.py 0.00% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #175 +/- ## ===================================== Coverage 0.00% 0.00% ===================================== Files 7 7 Lines 1011 1011 Branches 215 215 ===================================== Misses 1011 1011 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

elfkuzco commented 6 months ago

Yes, it is okay.