code: def gre_shp_cp1252(tmpdir):
      """A tempdir containing copies of gre.* files, .cpg set to cp1252
  
      The shapefile attributes are in fact utf-8 encoded.
      """
      test_files = glob(
          os.path.join(os.path.dirname(__file__), "data/gre.*")
      )
      tmpdir = tmpdir.mkdir("data")
      for filename in test_files:
          shutil.copy(filename, str(tmpdir))
      tmpdir.join("gre.cpg").write("CP1252")
      yield tmpdir.join("gre.shp")
  
file_path: Fiona/tests/test_encoding.py
imports: from glob import glob
  import os
  import shutil
  import pytest
  import fiona
  from .conftest import requires_gdal2
label_desc: Use image node_id 1 for calling a global function with example usage: gre_shp_cp1252(tmpdir) without return types