Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
- Loading branch information
Showing
2 changed files
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,7 +176,10 @@ def __init__( | |
os.stat(self.source_path).st_ctime).replace(tzinfo=dateutil.tz.tzutc()).astimezone(tzinfo) | ||
|
||
# If time zone is set, build localized datetime. | ||
self.date = to_datetime(self.meta[self.default_lang]['date'], tzinfo) | ||
try: | ||
self.date = to_datetime(self.meta[self.default_lang]['date'], tzinfo) | ||
except ValueError: | ||
raise OSError("Invalid date '{0}' in file {1}".format(self.meta[self.default_lang]['date'], source_path)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Kwpolska
Author
Member
|
||
|
||
if 'updated' not in default_metadata: | ||
default_metadata['updated'] = default_metadata.get('date', None) | ||
|
why OSError? Maybe ValueError?