Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in check of file path #95

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

julia-bikova
Copy link

Previously, if you had entered a non-existent path load falling on a line 961 with an error "Not such file or directory: 'name_of_file.tmp'".
Changed check the file path: added an Exception when entering a non-existent path, plus refactoring - got rid of one variable.

Previously, if you had entered a non-existent path load falling on a line 961 with an error "Not such file or directory: 'name_of_file.tmp'".
Changed check the file path: added an Exception when entering a non-existent path, plus refactoring - got rid of one variable.
@landscape-bot
Copy link

Code Health
Repository health decreased by 0.68% when pulling d2c023a on julia-bikova:patch-1 into 77a00f2 on np1:develop.

IOError instead of common Exception
@landscape-bot
Copy link

Code Health
Repository health decreased by 0.68% when pulling 5a95694 on julia-bikova:patch-1 into 77a00f2 on np1:develop.

@ids1024
Copy link
Contributor

ids1024 commented Jun 12, 2015

FileNotFoundError is python 3 specific, but this change still doesn't seem necessary.

I used this command to test:

pafy.new('3jr7llQ6gNQ').streams[0].download(filepath='/tmp/doesntexist/file')

This was the result under python 3:

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/doesntexist/file.temp'

And python 2:

IOError: [Errno 2] No such file or directory: u'/tmp/doesntexist/file.temp'

Do you get different results? Am I missing something?

@julia-bikova
Copy link
Author

That's right, these results because FileNotFoundError error is specific for python 3, and will be displayed for python2 as IOError.

@ids1024
Copy link
Contributor

ids1024 commented Jun 17, 2015

My point is that even without this change, pafy still raises and IOError/FileNotFoundError, as that is what python's open() does in this case.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.51% when pulling 5a95694 on julia-bikova:patch-1 into 5fee450 on mps-youtube:develop.

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.

3 participants