Skip to content

campaigns.db prevents brightway project directory from being deleted #42

@pjamesjoyce

Description

@pjamesjoyce
projects.delete_project(delete_dir=True)
projects.delete_project('my_project', delete_dir=True)

and

projects.purge_deleted_directories()

fail with error:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\pjjoyce\\AppData\\Local\\pylca\\Brightway3\\my_project.8eb9cc4510ff31ac37ca85f9bbee44c1\\campaigns.db'

I think campaigns are a presamples thing right?

Shutting down all running instances of brightway and restarting a fresh brightway instance allows you to delete/purge project directories. But deleting only works if its the first command you use in a new brightway session

Steps to reproduce:

from brightway2 import *
projects.set_current('my_project') # in the create new project sense of set_current()
projects.delete_project(delete_dir=True)

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