Skip to content

Conversation

@yngvem
Copy link
Contributor

@yngvem yngvem commented Sep 2, 2024

Adds a save(filename: str, overwrite: bool = False)-function to turtle.py with the following input validation:

  • FileNotFoundError that explicitly state that the directory is missing if someone tries to save to an non-existing directory
  • ValueError if the file exists and overwrite=False
  • ValueError if the file does not end with ps or eps

Co-authored-by: Marie Roald [email protected]

@ghost
Copy link

ghost commented Sep 2, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Sep 2, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@nineteendo
Copy link
Contributor

Could you add documentation? And I would raise FileExistsError if the file already exists and overwrite is false.

@MarieRoald
Copy link
Contributor

We have updated the documentation now and changed the code to use the FileExistsError and make sure that the all pipeline checks pass

Copy link
Contributor

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants