Răsfoiți Sursa

Merge pull request #4388 from ThomasWaldmann/utf8-default

utf-8 is the default
TW 6 ani în urmă
părinte
comite
1a2691c6e4
7 a modificat fișierele cu 4 adăugiri și 8 ștergeri
  1. 0 2
      docs/conf.py
  2. 1 1
      scripts/glibc_check.py
  3. 0 1
      setup.py
  4. 0 1
      setup_docs.py
  5. 1 1
      src/borg/archiver.py
  6. 1 1
      src/borg/helpers/manifest.py
  7. 1 1
      src/borg/remote.py

+ 0 - 2
docs/conf.py

@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-#
 # documentation build configuration file, created by
 # sphinx-quickstart on Sat Sep 10 18:18:25 2011.
 #

+ 1 - 1
scripts/glibc_check.py

@@ -34,7 +34,7 @@ def main():
         try:
             output = subprocess.check_output(objdump % filename, shell=True,
                                              stderr=subprocess.STDOUT)
-            output = output.decode('utf-8')
+            output = output.decode()
             versions = set(parse_version(match.group(1))
                            for match in glibc_re.finditer(output))
             requires_glibc = max(versions)

+ 0 - 1
setup.py

@@ -1,4 +1,3 @@
-# -*- encoding: utf-8 *-*
 import os
 import io
 import re

+ 0 - 1
setup_docs.py

@@ -1,4 +1,3 @@
-# -*- encoding: utf-8 *-*
 # Support code for building docs (build_usage, build_man)
 
 import os

+ 1 - 1
src/borg/archiver.py

@@ -1847,7 +1847,7 @@ class Archiver:
             if wanted.startswith('hex:'):
                 wanted = unhexlify(wanted[4:])
             elif wanted.startswith('str:'):
-                wanted = wanted[4:].encode('utf-8')
+                wanted = wanted[4:].encode()
             else:
                 raise ValueError('unsupported search term')
         except (ValueError, UnicodeEncodeError):

+ 1 - 1
src/borg/helpers/manifest.py

@@ -54,7 +54,7 @@ class Archives(abc.MutableMapping):
         values = self._archives.get(_name)
         if values is None:
             raise KeyError
-        ts = parse_timestamp(values[b'time'].decode('utf-8'))
+        ts = parse_timestamp(values[b'time'].decode())
         return ArchiveInfo(name=name, id=values[b'id'], ts=ts)
 
     def __setitem__(self, name, info):

+ 1 - 1
src/borg/remote.py

@@ -848,7 +848,7 @@ This problem will go away as soon as the server has been upgraded to 1.0.7+.
                         self.stderr_received = lines.pop()
                     # now we have complete lines in <lines> and any partial line in self.stderr_received.
                     for line in lines:
-                        handle_remote_line(line.decode('utf-8'))  # decode late, avoid partial utf-8 sequences
+                        handle_remote_line(line.decode())  # decode late, avoid partial utf-8 sequences
             if w:
                 while not self.to_send and (calls or self.preload_ids) and len(waiting_for) < MAX_INFLIGHT:
                     if calls: