Skip to content

Conversation

piotrkochan
Copy link
Contributor

  • parse json - .json files
  • parse ast - raw .py dist
  • parse .py as normal if other ways failed



def get_desired_capabilities(cap_file):
f = open(cap_file, 'r')
Copy link
Member

Choose a reason for hiding this comment

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

You have to verify the file type before doing any kind of file parsing.

@mdmintz
Copy link
Member

mdmintz commented Dec 30, 2019

@piotrkochan I added the review. You should verify the file type before parsing the desired capabilities file. Thanks for contributing this pull request!

Comment on lines +191 to +192
else:
raise Exception("\n\n`%s` is not a Python or JSON file!\n" % cap_file)
Copy link
Member

Choose a reason for hiding this comment

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

This part should happen before f = open(cap_file, 'r') if the file type is invalid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@mdmintz mdmintz merged commit 340ad10 into seleniumbase:master Dec 31, 2019
@mdmintz
Copy link
Member

mdmintz commented Dec 31, 2019

@piotrkochan Merged! It'll be part of the next release. 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.

2 participants