Skip to content

Filesystem::dumpFile() tries to remove not existing file on symfony/filesystem 5.1.9 #39235

Closed
@gechetspr

Description

@gechetspr

Symfony version(s) affected: 5.1.9

Description
On our project we have a custom error handler that shows all errors, even ignored one.
With this update symfony/filesystem@v5.1.8...v5.1.9 we try to unlink temporary file in any case, even if it was successfully renamed.
Because we have this custom error handler, now we get an error every time we try to dump a file.

How to reproduce
Update symfony/filesystem to at least version 5.1.9. Try to dump file via Filesystem;

Possible Solution
We can use catch (Throwable $e) { @unlink($tmpFile); throw $e;} instead of finally block

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions