Merge lp:~mgorse/duplicity/0.8-series into lp:~duplicity-team/duplicity/0.8-series

Proposed by Mgorse
Status: Merged
Merged at revision: 1349
Proposed branch: lp:~mgorse/duplicity/0.8-series
Merge into: lp:~duplicity-team/duplicity/0.8-series
Diff against target: 580 lines (+93/-76)
8 files modified
duplicity/backends/lftpbackend.py (+2/-2)
duplicity/collections.py (+3/-3)
duplicity/lazy.py (+13/-3)
duplicity/patchdir.py (+5/-2)
duplicity/path.py (+1/-1)
duplicity/statistics.py (+1/-1)
duplicity/tempdir.py (+1/-1)
po/duplicity.pot (+67/-63)
To merge this branch: bzr merge lp:~mgorse/duplicity/0.8-series
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+363565@code.launchpad.net

Commit message

Python3 fixes

To post a comment you must log in.
lp:~mgorse/duplicity/0.8-series updated
1349. By Kenneth Loafman

* Merged in lp:~mgorse/duplicity/0.8-series
  - More changes for unicode and py3 support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/backends/lftpbackend.py'
2--- duplicity/backends/lftpbackend.py 2018-11-29 19:00:15 +0000
3+++ duplicity/backends/lftpbackend.py 2019-02-22 20:25:46 +0000
4@@ -132,12 +132,12 @@
5 self.tempfile.write(u"set net:max-retries %s\n" % globals.num_retries)
6 self.tempfile.write(u"set ftp:passive-mode %s\n" % self.conn_opt)
7 if log.getverbosity() >= log.DEBUG:
8- self.tempfd.write(u"debug\n")
9+ self.tempfile.write(u"debug\n")
10 if self.parsed_url.scheme == u'ftpes':
11 self.tempfile.write(u"open %s %s\n" % (self.authflag, self.url_string.replace(u'ftpes', u'ftp')))
12 else:
13 self.tempfile.write(u"open %s %s\n" % (self.authflag, self.url_string))
14- os.close(self.tempfd)
15+ self.tempfile.close()
16 # print settings in debug mode
17 if log.getverbosity() >= log.DEBUG:
18 f = open(self.tempname, u'r')
19
20=== modified file 'duplicity/collections.py'
21--- duplicity/collections.py 2018-11-29 19:00:15 +0000
22+++ duplicity/collections.py 2019-02-22 20:25:46 +0000
23@@ -193,7 +193,7 @@
24 pass
25 util.release_lockfile()
26
27- def __unicode__(self):
28+ def __str__(self):
29 u"""
30 For now just list files in set
31 """
32@@ -657,7 +657,7 @@
33
34 return l
35
36- def __unicode__(self):
37+ def __str__(self):
38 u"""
39 Return string summary of the collection
40 """
41@@ -1228,7 +1228,7 @@
42 self.filepath = filepath
43 self.fileinfo_list = fileinfo_list
44
45- def __unicode__(self):
46+ def __str__(self):
47 set_schema = u"%20s %30s %20s"
48 l = [u"-------------------------",
49 _(u"File: %s") % (self.filepath),
50
51=== modified file 'duplicity/lazy.py'
52--- duplicity/lazy.py 2018-11-29 19:00:15 +0000
53+++ duplicity/lazy.py 2019-02-22 20:25:46 +0000
54@@ -206,7 +206,11 @@
55
56 def make_iterator(fork_num):
57 while(1):
58- yield get_next(fork_num)
59+ try:
60+ ret = get_next(fork_num)
61+ except StopIteration:
62+ return
63+ yield ret
64
65 return tuple(map(make_iterator, list(range(num_of_forks))))
66
67@@ -230,7 +234,10 @@
68 while(1):
69 if self.a_leading_by >= 0:
70 # a is in front, add new element
71- elem = next(iter) # exception will be passed
72+ try:
73+ elem = next(iter)
74+ except StopIteration:
75+ return
76 buf.append(elem)
77 else:
78 # b is in front, subtract an element
79@@ -244,7 +251,10 @@
80 while(1):
81 if self.a_leading_by <= 0:
82 # b is in front, add new element
83- elem = next(iter) # exception will be passed
84+ try:
85+ elem = next(iter)
86+ except StopIteration:
87+ return
88 buf.append(elem)
89 else:
90 # a is in front, subtract an element
91
92=== modified file 'duplicity/patchdir.py'
93--- duplicity/patchdir.py 2018-11-29 19:00:15 +0000
94+++ duplicity/patchdir.py 2019-02-22 20:25:46 +0000
95@@ -128,7 +128,7 @@
96 while 1:
97 # This section relevant when a multivol diff is last in tar
98 if not tarinfo_list[0]:
99- raise StopIteration
100+ return
101 if multivol_fileobj and not multivol_fileobj.at_end:
102 multivol_fileobj.close() # aborting in middle of multivol
103 continue
104@@ -149,7 +149,10 @@
105 else:
106 ropath.setfileobj(diff_tarfile.extractfile(tarinfo_list[0]))
107 yield ropath
108- tarinfo_list[0] = next(tar_iter)
109+ try:
110+ tarinfo_list[0] = next(tar_iter)
111+ except StopIteration:
112+ return
113
114
115 def get_index_from_tarinfo(tarinfo):
116
117=== modified file 'duplicity/path.py'
118--- duplicity/path.py 2018-11-29 19:00:15 +0000
119+++ duplicity/path.py 2019-02-22 20:25:46 +0000
120@@ -487,7 +487,7 @@
121 other.stat = stat
122 other.mode = self.mode
123
124- def __unicode__(self):
125+ def __str__(self):
126 u"""Return string representation"""
127 return u"(%s %s)" % (util.uindex(self.index), self.type)
128
129
130=== modified file 'duplicity/statistics.py'
131--- duplicity/statistics.py 2018-11-29 19:00:15 +0000
132+++ duplicity/statistics.py 2019-02-22 20:25:46 +0000
133@@ -118,7 +118,7 @@
134 if use_repr:
135 # use repr to quote newlines in relative filename, then
136 # take of leading and trailing quote and quote spaces.
137- filename = self.space_regex.sub(u"\\x20", repr(filename))
138+ filename = self.space_regex.sub(u"\\\\x20", repr(filename))
139 n = 1
140 if filename[0] == u'u':
141 n = 2
142
143=== modified file 'duplicity/tempdir.py'
144--- duplicity/tempdir.py 2018-11-29 19:00:15 +0000
145+++ duplicity/tempdir.py 2019-02-22 20:25:46 +0000
146@@ -174,7 +174,7 @@
147 try:
148 self.__tempcount = self.__tempcount + 1
149 suffix = u"-%d" % (self.__tempcount,)
150- filename = tempfile.mktemp(suffix, u"mktemp-", util.fsdecode(self.__dir))
151+ filename = util.fsencode(tempfile.mktemp(suffix, u"mktemp-", self.__dir))
152
153 log.Debug(_(u"Registering (mktemp) temporary file %s") % util.fsdecode(filename))
154 self.__pending[filename] = None
155
156=== modified file 'po/duplicity.pot'
157--- po/duplicity.pot 2018-12-23 16:52:31 +0000
158+++ po/duplicity.pot 2019-02-22 20:25:46 +0000
159@@ -8,7 +8,7 @@
160 msgstr ""
161 "Project-Id-Version: PACKAGE VERSION\n"
162 "Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"
163-"POT-Creation-Date: 2018-12-21 09:31-0600\n"
164+"POT-Creation-Date: 2019-02-22 13:13-0600\n"
165 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
166 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
167 "Language-Team: LANGUAGE <LL@li.org>\n"
168@@ -507,8 +507,8 @@
169 #. --archive-dir <path>
170 #: ../duplicity/commandline.py:290 ../duplicity/commandline.py:300
171 #: ../duplicity/commandline.py:321 ../duplicity/commandline.py:395
172-#: ../duplicity/commandline.py:413 ../duplicity/commandline.py:626
173-#: ../duplicity/commandline.py:659 ../duplicity/commandline.py:858
174+#: ../duplicity/commandline.py:413 ../duplicity/commandline.py:634
175+#: ../duplicity/commandline.py:667 ../duplicity/commandline.py:866
176 msgid "path"
177 msgstr ""
178
179@@ -519,8 +519,8 @@
180 #. Used in usage help to represent an ID for a GnuPG key. Example:
181 #. --encrypt-key <gpg_key_id>
182 #: ../duplicity/commandline.py:316 ../duplicity/commandline.py:323
183-#: ../duplicity/commandline.py:419 ../duplicity/commandline.py:610
184-#: ../duplicity/commandline.py:831
185+#: ../duplicity/commandline.py:419 ../duplicity/commandline.py:618
186+#: ../duplicity/commandline.py:839
187 msgid "gpg-key-id"
188 msgstr ""
189
190@@ -529,7 +529,7 @@
191 #. Example:
192 #. --exclude <shell_pattern>
193 #: ../duplicity/commandline.py:331 ../duplicity/commandline.py:444
194-#: ../duplicity/commandline.py:881
195+#: ../duplicity/commandline.py:889
196 msgid "shell_pattern"
197 msgstr ""
198
199@@ -538,7 +538,7 @@
200 #: ../duplicity/commandline.py:337 ../duplicity/commandline.py:346
201 #: ../duplicity/commandline.py:353 ../duplicity/commandline.py:446
202 #: ../duplicity/commandline.py:453 ../duplicity/commandline.py:466
203-#: ../duplicity/commandline.py:827
204+#: ../duplicity/commandline.py:835
205 msgid "filename"
206 msgstr ""
207
208@@ -551,7 +551,7 @@
209 #. point in time, as described in the documentation. Example:
210 #. duplicity remove-older-than time [options] target_url
211 #: ../duplicity/commandline.py:364 ../duplicity/commandline.py:407
212-#: ../duplicity/commandline.py:528 ../duplicity/commandline.py:913
213+#: ../duplicity/commandline.py:528 ../duplicity/commandline.py:921
214 msgid "time"
215 msgstr ""
216
217@@ -559,8 +559,8 @@
218 #. header.) Example:
219 #. duplicity [full|incremental] [options] source_dir target_url
220 #: ../duplicity/commandline.py:415 ../duplicity/commandline.py:508
221-#: ../duplicity/commandline.py:531 ../duplicity/commandline.py:618
222-#: ../duplicity/commandline.py:846
223+#: ../duplicity/commandline.py:531 ../duplicity/commandline.py:626
224+#: ../duplicity/commandline.py:854
225 msgid "options"
226 msgstr ""
227
228@@ -586,9 +586,9 @@
229 #: ../duplicity/commandline.py:471 ../duplicity/commandline.py:493
230 #: ../duplicity/commandline.py:505 ../duplicity/commandline.py:514
231 #: ../duplicity/commandline.py:558 ../duplicity/commandline.py:563
232-#: ../duplicity/commandline.py:567 ../duplicity/commandline.py:581
233-#: ../duplicity/commandline.py:587 ../duplicity/commandline.py:591
234-#: ../duplicity/commandline.py:654 ../duplicity/commandline.py:841
235+#: ../duplicity/commandline.py:567 ../duplicity/commandline.py:586
236+#: ../duplicity/commandline.py:592 ../duplicity/commandline.py:596
237+#: ../duplicity/commandline.py:662 ../duplicity/commandline.py:849
238 msgid "number"
239 msgstr ""
240
241@@ -597,25 +597,29 @@
242 msgid "backup name"
243 msgstr ""
244
245-#: ../duplicity/commandline.py:576
246+#: ../duplicity/commandline.py:581
247 msgid "policy"
248 msgstr ""
249
250+#: ../duplicity/commandline.py:599
251+msgid "Hot|Cool|Archive"
252+msgstr ""
253+
254 #. noun
255-#: ../duplicity/commandline.py:594 ../duplicity/commandline.py:597
256-#: ../duplicity/commandline.py:812
257+#: ../duplicity/commandline.py:602 ../duplicity/commandline.py:605
258+#: ../duplicity/commandline.py:820
259 msgid "command"
260 msgstr ""
261
262-#: ../duplicity/commandline.py:600
263+#: ../duplicity/commandline.py:608
264 msgid "pyrax|cloudfiles"
265 msgstr ""
266
267-#: ../duplicity/commandline.py:621
268+#: ../duplicity/commandline.py:629
269 msgid "pem formatted bundle of certificate authorities"
270 msgstr ""
271
272-#: ../duplicity/commandline.py:622
273+#: ../duplicity/commandline.py:630
274 msgid "path to a folder with certificate authority files"
275 msgstr ""
276
277@@ -625,113 +629,113 @@
278 #. --backend-retry-delay <seconds>
279 #. Used in usage help. Example:
280 #. --timeout <seconds>
281-#: ../duplicity/commandline.py:631 ../duplicity/commandline.py:665
282-#: ../duplicity/commandline.py:875
283+#: ../duplicity/commandline.py:639 ../duplicity/commandline.py:673
284+#: ../duplicity/commandline.py:883
285 msgid "seconds"
286 msgstr ""
287
288 #. abbreviation for "character" (noun)
289-#: ../duplicity/commandline.py:637 ../duplicity/commandline.py:809
290+#: ../duplicity/commandline.py:645 ../duplicity/commandline.py:817
291 msgid "char"
292 msgstr ""
293
294-#: ../duplicity/commandline.py:775
295+#: ../duplicity/commandline.py:783
296 #, python-format
297 msgid "Using archive dir: %s"
298 msgstr ""
299
300-#: ../duplicity/commandline.py:776
301+#: ../duplicity/commandline.py:784
302 #, python-format
303 msgid "Using backup name: %s"
304 msgstr ""
305
306-#: ../duplicity/commandline.py:783
307+#: ../duplicity/commandline.py:791
308 #, python-format
309 msgid "Command line error: %s"
310 msgstr ""
311
312-#: ../duplicity/commandline.py:784
313+#: ../duplicity/commandline.py:792
314 msgid "Enter 'duplicity --help' for help screen."
315 msgstr ""
316
317 #. Used in usage help to represent a Unix-style path name. Example:
318 #. rsync://user[:password]@other_host[:port]//absolute_path
319-#: ../duplicity/commandline.py:797
320+#: ../duplicity/commandline.py:805
321 msgid "absolute_path"
322 msgstr ""
323
324 #. Used in usage help. Example:
325 #. tahoe://alias/some_dir
326-#: ../duplicity/commandline.py:801
327+#: ../duplicity/commandline.py:809
328 msgid "alias"
329 msgstr ""
330
331 #. Used in help to represent a "bucket name" for Amazon Web
332 #. Services' Simple Storage Service (S3). Example:
333 #. s3://other.host/bucket_name[/prefix]
334-#: ../duplicity/commandline.py:806
335+#: ../duplicity/commandline.py:814
336 msgid "bucket_name"
337 msgstr ""
338
339 #. Used in usage help to represent the name of a container in
340 #. Amazon Web Services' Cloudfront. Example:
341 #. cf+http://container_name
342-#: ../duplicity/commandline.py:817
343+#: ../duplicity/commandline.py:825
344 msgid "container_name"
345 msgstr ""
346
347 #. noun
348-#: ../duplicity/commandline.py:820
349+#: ../duplicity/commandline.py:828
350 msgid "count"
351 msgstr ""
352
353 #. Used in usage help to represent the name of a file directory
354-#: ../duplicity/commandline.py:823
355+#: ../duplicity/commandline.py:831
356 msgid "directory"
357 msgstr ""
358
359 #. Used in usage help, e.g. to represent the name of a code
360 #. module. Example:
361 #. rsync://user[:password]@other.host[:port]::/module/some_dir
362-#: ../duplicity/commandline.py:836
363+#: ../duplicity/commandline.py:844
364 msgid "module"
365 msgstr ""
366
367 #. Used in usage help to represent an internet hostname. Example:
368 #. ftp://user[:password]@other.host[:port]/some_dir
369-#: ../duplicity/commandline.py:850
370+#: ../duplicity/commandline.py:858
371 msgid "other.host"
372 msgstr ""
373
374 #. Used in usage help. Example:
375 #. ftp://user[:password]@other.host[:port]/some_dir
376-#: ../duplicity/commandline.py:854
377+#: ../duplicity/commandline.py:862
378 msgid "password"
379 msgstr ""
380
381 #. Used in usage help to represent a TCP port number. Example:
382 #. ftp://user[:password]@other.host[:port]/some_dir
383-#: ../duplicity/commandline.py:862
384+#: ../duplicity/commandline.py:870
385 msgid "port"
386 msgstr ""
387
388 #. Used in usage help. This represents a string to be used as a
389 #. prefix to names for backup files created by Duplicity. Example:
390 #. s3://other.host/bucket_name[/prefix]
391-#: ../duplicity/commandline.py:867
392+#: ../duplicity/commandline.py:875
393 msgid "prefix"
394 msgstr ""
395
396 #. Used in usage help to represent a Unix-style path name. Example:
397 #. rsync://user[:password]@other.host[:port]/relative_path
398-#: ../duplicity/commandline.py:871
399+#: ../duplicity/commandline.py:879
400 msgid "relative_path"
401 msgstr ""
402
403 #. Used in usage help to represent the name of a single file
404 #. directory or a Unix-style path to a directory. Example:
405 #. file:///some_dir
406-#: ../duplicity/commandline.py:886
407+#: ../duplicity/commandline.py:894
408 msgid "some_dir"
409 msgstr ""
410
411@@ -739,14 +743,14 @@
412 #. directory or a Unix-style path to a directory where files will be
413 #. coming FROM. Example:
414 #. duplicity [full|incremental] [options] source_dir target_url
415-#: ../duplicity/commandline.py:892
416+#: ../duplicity/commandline.py:900
417 msgid "source_dir"
418 msgstr ""
419
420 #. Used in usage help to represent a URL files will be coming
421 #. FROM. Example:
422 #. duplicity [restore] [options] source_url target_dir
423-#: ../duplicity/commandline.py:897
424+#: ../duplicity/commandline.py:905
425 msgid "source_url"
426 msgstr ""
427
428@@ -754,91 +758,91 @@
429 #. directory or a Unix-style path to a directory. where files will be
430 #. going TO. Example:
431 #. duplicity [restore] [options] source_url target_dir
432-#: ../duplicity/commandline.py:903
433+#: ../duplicity/commandline.py:911
434 msgid "target_dir"
435 msgstr ""
436
437 #. Used in usage help to represent a URL files will be going TO.
438 #. Example:
439 #. duplicity [full|incremental] [options] source_dir target_url
440-#: ../duplicity/commandline.py:908
441+#: ../duplicity/commandline.py:916
442 msgid "target_url"
443 msgstr ""
444
445 #. Used in usage help to represent a user name (i.e. login).
446 #. Example:
447 #. ftp://user[:password]@other.host[:port]/some_dir
448-#: ../duplicity/commandline.py:918
449+#: ../duplicity/commandline.py:926
450 msgid "user"
451 msgstr ""
452
453 #. account id for b2. Example: b2://account_id@bucket/
454-#: ../duplicity/commandline.py:921
455+#: ../duplicity/commandline.py:929
456 msgid "account_id"
457 msgstr ""
458
459 #. application_key for b2.
460 #. Example: b2://account_id:application_key@bucket/
461-#: ../duplicity/commandline.py:925
462+#: ../duplicity/commandline.py:933
463 msgid "application_key"
464 msgstr ""
465
466 #. Header in usage help
467-#: ../duplicity/commandline.py:944
468+#: ../duplicity/commandline.py:952
469 msgid "Backends and their URL formats:"
470 msgstr ""
471
472 #. Header in usage help
473-#: ../duplicity/commandline.py:976
474+#: ../duplicity/commandline.py:984
475 msgid "Commands:"
476 msgstr ""
477
478-#: ../duplicity/commandline.py:1001
479+#: ../duplicity/commandline.py:1009
480 #, python-format
481 msgid "Specified archive directory '%s' does not exist, or is not a directory"
482 msgstr ""
483
484-#: ../duplicity/commandline.py:1010
485+#: ../duplicity/commandline.py:1018
486 #, python-format
487 msgid ""
488 "Sign key should be an 8, 16 alt. 40 character hex string, like 'AA0E73D2'.\n"
489 "Received '%s' instead."
490 msgstr ""
491
492-#: ../duplicity/commandline.py:1070
493+#: ../duplicity/commandline.py:1078
494 #, python-format
495 msgid ""
496 "Restore destination directory %s already exists.\n"
497 "Will not overwrite."
498 msgstr ""
499
500-#: ../duplicity/commandline.py:1075
501+#: ../duplicity/commandline.py:1083
502 #, python-format
503 msgid "Verify directory %s does not exist"
504 msgstr ""
505
506-#: ../duplicity/commandline.py:1081
507+#: ../duplicity/commandline.py:1089
508 #, python-format
509 msgid "Backup source directory %s does not exist."
510 msgstr ""
511
512-#: ../duplicity/commandline.py:1112
513+#: ../duplicity/commandline.py:1120
514 #, python-format
515 msgid "Command line warning: %s"
516 msgstr ""
517
518-#: ../duplicity/commandline.py:1112
519+#: ../duplicity/commandline.py:1120
520 msgid ""
521 "Selection options --exclude/--include\n"
522 "currently work only when backing up,not restoring."
523 msgstr ""
524
525-#: ../duplicity/commandline.py:1148
526+#: ../duplicity/commandline.py:1156
527 #, python-format
528 msgid "GPG binary is %s, version %s"
529 msgstr ""
530
531-#: ../duplicity/commandline.py:1175
532+#: ../duplicity/commandline.py:1183
533 #, python-format
534 msgid ""
535 "Bad URL '%s'.\n"
536@@ -846,7 +850,7 @@
537 "\"file:///usr/local\". See the man page for more information."
538 msgstr ""
539
540-#: ../duplicity/commandline.py:1205
541+#: ../duplicity/commandline.py:1213
542 msgid "Main action: "
543 msgstr ""
544
545@@ -931,12 +935,12 @@
546 msgid "Patching %s"
547 msgstr ""
548
549-#: ../duplicity/patchdir.py:542
550+#: ../duplicity/patchdir.py:545
551 #, python-format
552 msgid "Error '%s' patching %s"
553 msgstr ""
554
555-#: ../duplicity/patchdir.py:617
556+#: ../duplicity/patchdir.py:620
557 #, python-format
558 msgid "Writing %s of type %s"
559 msgstr ""
560@@ -1228,17 +1232,17 @@
561 msgid "D %s"
562 msgstr ""
563
564-#: ../duplicity/lazy.py:342
565+#: ../duplicity/lazy.py:352
566 #, python-format
567 msgid "Warning: oldindex %s >= newindex %s"
568 msgstr ""
569
570-#: ../duplicity/lazy.py:417
571+#: ../duplicity/lazy.py:427
572 #, python-format
573 msgid "Error '%s' processing %s"
574 msgstr ""
575
576-#: ../duplicity/lazy.py:427
577+#: ../duplicity/lazy.py:437
578 #, python-format
579 msgid "Skipping %s because of previous error"
580 msgstr ""

Subscribers

People subscribed via source and target branches