utility.py: os.remove instead of os.path.remove

Issue #52 closed
R Fox created an issue

Hi,

I’m getting a fatal exception raised when running on a partially completed run.

utility.py:28 in clean_files_in_dir calls os.path.remove() but it doesn’t exist. I changed it to os.remove() which resolves the problem.

Can’t seem to create a pull request for this so here’s the modification illustrated:

iphop/modules/utility.py

def clean_files_in_dir(dir_path,logger):
    tab_tmp = glob.glob(os.path.join(dir_path,"*.*"))
    for file in tab_tmp:
        if os.path.isfile(file):
            logger.debug(f"Removing file {file} as we clean up dir {dir_path}")
            os.remove(file)

Comments (2)

  1. Simon Roux repo owner

    Hi, and thanks for flagging this issue ! Out of curiosity, do you have access to https://bitbucket.org/srouxjgi/iphop/pull-requests/ and can you create a PR there ? (I don’t think it’s needed and I’m happy to fix it via a commit on my side, I just was expecting the PR system to work so curious to see what causes issues and if it’s something I can fix).

    Thanks,

    Best,

    Simon

  2. Log in to comment