Skip to content

write_to_textfile: fails to overwrite file on windows #649

Closed

Description

@johanvdw

On linux, write_to_textfile can overwrite an existing file.
However, this fails if we try this on windows:

"C:\...\dashboard\metrics.py", line 169, in write_metrics
write_to_textfile(outfile, registry)
File "C:\...\env\lib\site-packages\prometheus_client\exposition.py", line 275, in write_to_textfile
os.rename(tmppath, path)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: '..\metrics\cable_alert.prom.6092.3608' -> '..\metrics\cable_alert.prom'

Activity

  1. bluppfisk commented on May 12, 2021

    @bluppfisk
    Contributor

    should be good to close now with #650 merged. Thanks Chris!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions