code: def test_byte_filenames(self):
      # somebody renamed a file from ISO-8859-2 to UTF-8
      fna = b"\xb3odz.txt"  # "łodz.txt"
      fnb = b"\xc5\x82odz.txt"
  
      # they transcoded the content at the same time
      a = [b"\xa3odz is a city in Poland."]
      b = [b"\xc5\x81odz is a city in Poland."]
  
      check = self.check
      unified = difflib.unified_diff
      context = difflib.context_diff
      check(difflib.diff_bytes(unified, a, b, fna, fnb))
      check(difflib.diff_bytes(context, a, b, fna, fnb))
  
      def assertDiff(expect, actual):
          # do not compare expect and equal as lists, because unittest
          # uses difflib to report difference between lists
          actual = list(actual)
          self.assertEqual(len(expect), len(actual))
          for e, a in zip(expect, actual):
              self.assertEqual(e, a)
  
      expect = [
          b"--- \xb3odz.txt",
          b"+++ \xc5\x82odz.txt",
          b"@@ -1 +1 @@",
          b"-\xa3odz is a city in Poland.",
          b"+\xc5\x81odz is a city in Poland.",
      ]
      actual = difflib.diff_bytes(unified, a, b, fna, fnb, lineterm=b"")
      assertDiff(expect, actual)
  
      # with dates (plain ASCII)
      datea = b"2005-03-18"
      dateb = b"2005-03-19"
      check(difflib.diff_bytes(unified, a, b, fna, fnb, datea, dateb))
      check(difflib.diff_bytes(context, a, b, fna, fnb, datea, dateb))
  
      expect = [
          # note the mixed encodings here: this is deeply wrong by every
          # tenet of Unicode, but it doesn't crash, it's parseable by
          # patch, and it's how UNIX(tm) diff behaves
          b"--- \xb3odz.txt\t2005-03-18",
          b"+++ \xc5\x82odz.txt\t2005-03-19",
          b"@@ -1 +1 @@",
          b"-\xa3odz is a city in Poland.",
          b"+\xc5\x81odz is a city in Poland.",
      ]
      actual = difflib.diff_bytes(
          unified, a, b, fna, fnb, datea, dateb, lineterm=b""
      )
      assertDiff(expect, actual)
  
imports: import difflib
  from test.support import findfile
  import unittest
  import doctest
  import sys
label_desc: Use image node_id 3 for calling the TestBytes obj's underlying member method code with example usage: obj.test_byte_filenames() without return types