ko-zu / psl

publicsuffixlist for python
Mozilla Public License 2.0
62 stars 10 forks source link

`--help` fails on win #23

Closed BastianZim closed 1 year ago

BastianZim commented 1 year ago

When running publicsuffixlist-download --help on windows, I get the following error:

Error:

Traceback (most recent call last):
  File "C:\bld\publicsuffixlist_1675107463020\_test_env\Scripts\publicsuffixlist-download-script.py", line 9, in <module>
    sys.exit(updatePSL())
             ^^^^^^^^^^^
  File "C:\bld\publicsuffixlist_1675107463020\_test_env\Lib\site-packages\publicsuffixlist\update.py", line 41, in updatePSL
    os.rename(psl_file + ".swp", psl_file)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\bld\\publicsuffixlist_1675107463020\\_test_env\\Lib\\site-packages\\publicsuffixlist\\public_suffix_list.dat.swp' -> 'C:\\bld\\publicsuffixlist_1675107463020\\_test_env\\Lib\\site-packages\\publicsuffixlist\\public_suffix_list.dat'

Logs: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=650026&view=logs&j=3ff94dba-189a-527c-65e3-ce8503824159&t=35acf2bd-66a8-5b9f-4368-b52d351bfcc2 Context: https://github.com/conda-forge/staged-recipes/pull/21906

ko-zu commented 1 year ago

This should fix the case. https://github.com/ko-zu/psl/commit/8ae0d582c09e1b7db7f9ef7c9b4fbee43a56fd0f however, this update script does not have any options. It just downloads and replaces the embedded psl_file.

BastianZim commented 1 year ago

Thanks!

It's just part of our testing to make sure the most important parts work so we just want to make sure that at least something gets returned. Do you mind creating a new release or should I include it as a patch?

ko-zu commented 1 year ago

pushed the changes to pypi as 0.9.3.

BastianZim commented 1 year ago

Thanks!