Skip to content

Commit 6ef69ca

Browse files
Merge pull request #155 from islue/utf8_codec_cant_decode
missing another decode_file_iter
2 parents eb0c0be + a1de3c0 commit 6ef69ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mongodb_consistent_backup/Oplog/Resolver/ResolverThread.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Skip bson in requirements , pymongo provides
44
# noinspection PyPackageRequirements
55
from bson import decode_file_iter
6+
from bson.codec_options import CodecOptions
67

78
from mongodb_consistent_backup.Errors import Error
89
from mongodb_consistent_backup.Oplog import Oplog
@@ -33,7 +34,7 @@ def run(self):
3334
self.state.set('first_ts', self.mongodump_oplog['first_ts'])
3435
if not self.state.get('first_ts'):
3536
self.state.set('first_ts', self.tailed_oplog['first_ts'])
36-
for change in decode_file_iter(self.oplogs['tailed']):
37+
for change in decode_file_iter(self.oplogs['tailed'], CodecOptions(unicode_decode_error_handler="ignore")):
3738
self.last_ts = change['ts']
3839
if not self.mongodump_oplog['last_ts'] or self.last_ts > self.mongodump_oplog['last_ts']:
3940
if self.last_ts < self.max_end_ts:

0 commit comments

Comments
 (0)