Skip to content

Conversation

@PurityLake
Copy link
Contributor

@PurityLake PurityLake commented May 24, 2023

Refers to #104527

When writing to a zipfile, I have added a check for ensuring that there is no recursive writing of the open zipfile into that zipfile. I use os.path.abspath to ensure the file names are exactly the same.


if isinstance(self.filename, os.PathLike) or isinstance(self.filename, bytes) \
or isinstance(self.filename, str):
if os.path.abspath(filename) == os.path.abspath(self.filename):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might want to use os.path.resolve() here, to resolve symlinks as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make this fix later on today

@PurityLake PurityLake closed this Mar 14, 2024
@PurityLake PurityLake deleted the gh104527-fix branch March 14, 2024 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants