Skip to content

Issues running project and tests on Windows #1

@denini08

Description

@denini08

Hi,

I was trying to run the project and the tests on Windows, and I noticed a few problems.

  1. When running the project, I got the following error:
Skipping item Traceback (most recent call last):
  File "/feedme/feedme.py", line 806, in get_feed
    if item_id in feedcachedict:
                  ^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'feedcachedict' where it is not associated with a value

This error also happened on macOS and Linux, so it seems to be cross-platform.

  1. Windows-specific issues

(a) File handling error

Renaming C:\Users\root\feeds\LOG to C:\Users\root\feeds\09-25-Thu\LOG
Couldn't move LOG or create MANIFEST:
[WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\root\\feeds\\LOG' -> 'C:\\Users\\root\\feeds\\09-25-Thu\\LOG'

This is because the file still open before move.

(b) Path handling error

[WinError 3] The system cannot find the path specified: 
'C:\\Users\\root\\feeds\\LOG' -> 'C:\\Users\\root\\feeds\\09-25-Thu\\LOG'
Cleaning up files older than 7 days from feed and cache dirs

This is because on Windows, we need to make the dir before

(c) Encoding issue in tests

test\test_feedme.py:79: in read_two_files
    newcontents = newfp.read()
...
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 14312: character maps to <undefined>

This seems related to default Windows encoding (cp1252) vs. UTF-8.

I’ll work on a fix for these issues and open a pull request soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions