summaryrefslogtreecommitdiffhomepage
path: root/libs/pysrt
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-01-23 23:07:52 -0500
committermorpheus65535 <[email protected]>2022-01-23 23:07:52 -0500
commit0c3c5a02a75bc61b6bf6e303de20e11741d2afac (patch)
tree30ae1d524ffe5d54172b7a4a8445d90c3461e659 /libs/pysrt
parent36bf0d219d0432c20e6314e0ce752b36f4d88e3c (diff)
downloadbazarr-0c3c5a02a75bc61b6bf6e303de20e11741d2afac.tar.gz
bazarr-0c3c5a02a75bc61b6bf6e303de20e11741d2afac.zip
Upgraded vendored Python dependencies to the latest versions and removed the unused dependencies.v1.0.3-beta.16
Diffstat (limited to 'libs/pysrt')
-rw-r--r--libs/pysrt/commands.py12
-rw-r--r--libs/pysrt/srtfile.py2
2 files changed, 10 insertions, 4 deletions
diff --git a/libs/pysrt/commands.py b/libs/pysrt/commands.py
index 05bf78cf5..b2bfa24fb 100644
--- a/libs/pysrt/commands.py
+++ b/libs/pysrt/commands.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable-all
+from __future__ import print_function
import os
import re
@@ -132,9 +133,14 @@ class SubRipShifter(object):
def run(self, args):
self.arguments = self.build_parser().parse_args(args)
- if self.arguments.in_place:
- self.create_backup()
- self.arguments.action()
+
+ if os.path.isfile(self.arguments.file):
+ if self.arguments.in_place:
+ self.create_backup()
+ self.arguments.action()
+
+ else:
+ print('No such file', self.arguments.file)
def parse_time(self, time_string):
negative = time_string.startswith('-')
diff --git a/libs/pysrt/srtfile.py b/libs/pysrt/srtfile.py
index c03595af5..bcdb482a0 100644
--- a/libs/pysrt/srtfile.py
+++ b/libs/pysrt/srtfile.py
@@ -290,7 +290,7 @@ class SubRipFile(UserList, object):
@classmethod
def _open_unicode_file(cls, path, claimed_encoding=None):
encoding = claimed_encoding or cls._detect_encoding(path)
- source_file = codecs.open(path, 'rU', encoding=encoding)
+ source_file = codecs.open(path, 'r', encoding=encoding)
# get rid of BOM if any
possible_bom = CODECS_BOMS.get(encoding, None)