Skip to content

Commit

Permalink
Default PathStyle is False and doesn't exist in the config
Browse files Browse the repository at this point in the history
  • Loading branch information
vorlock committed Nov 30, 2024
1 parent 4a8879f commit a66f80d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions s3
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,17 @@ cause is that you don't have IAM role on this machine")
it is return it as bool.
If in the config is not a boolean but some rubish throw a type error.
"""
# getting path style from config file
path_style = config.as_bool('PathStyle')
try:
# getting path style from config file
path_style = config.as_bool('PathStyle')
except (KeyError, AttributeError):
path_style = False

if not isinstance(path_style, bool):
raise TypeError("PathStyle must be a boolean value")

self.path_style = path_style

return self.path_style
return path_style

def get_credentials(self):
"""
Expand Down

0 comments on commit a66f80d

Please sign in to comment.