prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Faker adds path objects to sys.path_importer_cache, breaking other packages
  * Faker version: 6.6.3
  * OS: Gentoo Linux
  
  After importing `faker`, entries with `PosixPath` objects are added as keys to `sys.path_importer_cache`. However, the keys are supposed to be regular `str`s there, and the wrong type breaks software relying on `str` methods being available, e.g. astroid:
  
  ```
  ___________________________________________ ClassNodeTest.test_slots_added_dynamically_still_inferred ____________________________________________
  
  self = <tests.unittest_scoped_nodes.ClassNodeTest testMethod=test_slots_added_dynamically_still_inferred>
  
      def tearDown(self):
          del sys.path[0]
          datadir = find("")
          for key in list(sys.path_importer_cache):
  >           if key.startswith(datadir):
  E           AttributeError: 'PosixPath' object has no attribute 'startswith'
  
  tests/resources.py:41: AttributeError
  ```
  
  Note that since Faker installs a pytest plugin, it is autoloaded by default in all programs' test suites.
  
  ### Steps to reproduce
  
  ```
  import sys
  import faker
  print(sys.path_importer_cache)
  ```
  
  ### Expected behavior
  
  The printed dict should only contain `str` keys.
  
  ### Actual behavior
  
  ```
  [...] PosixPath('/usr/lib/python3.9/site-packages/faker/providers/address'): FileFinder(PosixPath('/usr/lib/python3.9/site-packages/faker/providers/address')), PosixPath('/usr/lib/python3.9/site-packages/faker/providers/automotive'): FileFinder(PosixPath('/usr/lib/python3.9/site-packages/faker/providers/automotive')), [...]
  ```
  
  
  </issue>
  <code>
  [start of faker/utils/loading.py]
  1 import pkgutil
  2 import sys
  3 
  4 from importlib import import_module
  5 from pathlib import Path
  6 from types import ModuleType
  7 from typing import List, Set
  8 
  9 
  10 def get_path(module: ModuleType) -> str:
  11     if getattr(sys, 'frozen', False):
  12         # frozen
  13 
  14         if getattr(sys, '_MEIPASS', False):
  15             # PyInstaller
  16             lib_dir = Path(getattr(sys, '_MEIPASS'))
  17         else:
  18             # others
  19             lib_dir = Path(sys.executable).parent / 'lib'
  20 
  21         path = lib_dir.joinpath(*module.__package__.split("."))
  22     else:
  23         # unfrozen
  24         path = Path(module.__file__).parent
  25     return path
  26 
  27 
  28 def list_module(module: ModuleType) -> List[str]:
  29     path = get_path(module)
  30 
  31     if getattr(sys, '_MEIPASS', False):
  32         # PyInstaller
  33         return [file.parent.name for file in Path(path).glob('*/__init__.py')]
  34     else:
  35         return [name for _, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]
  36 
  37 
  38 def find_available_locales(providers: List[str]) -> List[str]:
  39     available_locales: Set[str] = set()
  40 
  41     for provider_path in providers:
  42 
  43         provider_module = import_module(provider_path)
  44         if getattr(provider_module, 'localized', False):
  45             langs = list_module(provider_module)
  46             available_locales.update(langs)
  47     available_locales: List[str] = sorted(available_locales)
  48     return available_locales
  49 
  50 
  51 def find_available_providers(modules: List[ModuleType]) -> List[str]:
  52     available_providers = set()
  53     for providers_mod in modules:
  54         if providers_mod.__package__:
  55             providers = [
  56                 '.'.join([providers_mod.__package__, mod])
  57                 for mod in list_module(providers_mod) if mod != '__pycache__'
  58             ]
  59             available_providers.update(providers)
  60     return sorted(available_providers)
  61
  [end of faker/utils/loading.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/faker/utils/loading.py b/faker/utils/loading.py
  --- a/faker/utils/loading.py
  +++ b/faker/utils/loading.py
  @@ -22,7 +22,7 @@
       else:
           # unfrozen
           path = Path(module.__file__).parent
  -    return path
  +    return str(path)
   
   
   def list_module(module: ModuleType) -> List[str]:
  
verification_info: {"golden_diff": "diff --git a/faker/utils/loading.py b/faker/utils/loading.py\n--- a/faker/utils/loading.py\n+++ b/faker/utils/loading.py\n@@ -22,7 +22,7 @@\n     else:\n         # unfrozen\n         path = Path(module.__file__).parent\n-    return path\n+    return str(path)\n \n \n def list_module(module: ModuleType) -> List[str]:\n", "issue": "Faker adds path objects to sys.path_importer_cache, breaking other packages\n* Faker version: 6.6.3\r\n* OS: Gentoo Linux\r\n\r\nAfter importing `faker`, entries with `PosixPath` objects are added as keys to `sys.path_importer_cache`. However, the keys are supposed to be regular `str`s there, and the wrong type breaks software relying on `str` methods being available, e.g. astroid:\r\n\r\n```\r\n___________________________________________ ClassNodeTest.test_slots_added_dynamically_still_inferred ____________________________________________\r\n\r\nself = <tests.unittest_scoped_nodes.ClassNodeTest testMethod=test_slots_added_dynamically_still_inferred>\r\n\r\n    def tearDown(self):\r\n        del sys.path[0]\r\n        datadir = find(\"\")\r\n        for key in list(sys.path_importer_cache):\r\n>           if key.startswith(datadir):\r\nE           AttributeError: 'PosixPath' object has no attribute 'startswith'\r\n\r\ntests/resources.py:41: AttributeError\r\n```\r\n\r\nNote that since Faker installs a pytest plugin, it is autoloaded by default in all programs' test suites.\r\n\r\n### Steps to reproduce\r\n\r\n```\r\nimport sys\r\nimport faker\r\nprint(sys.path_importer_cache)\r\n```\r\n\r\n### Expected behavior\r\n\r\nThe printed dict should only contain `str` keys.\r\n\r\n### Actual behavior\r\n\r\n```\r\n[...] PosixPath('/usr/lib/python3.9/site-packages/faker/providers/address'): FileFinder(PosixPath('/usr/lib/python3.9/site-packages/faker/providers/address')), PosixPath('/usr/lib/python3.9/site-packages/faker/providers/automotive'): FileFinder(PosixPath('/usr/lib/python3.9/site-packages/faker/providers/automotive')), [...]\r\n```\r\n\n", "before_files": [{"content": "import pkgutil\nimport sys\n\nfrom importlib import import_module\nfrom pathlib import Path\nfrom types import ModuleType\nfrom typing import List, Set\n\n\ndef get_path(module: ModuleType) -> str:\n    if getattr(sys, 'frozen', False):\n        # frozen\n\n        if getattr(sys, '_MEIPASS', False):\n            # PyInstaller\n            lib_dir = Path(getattr(sys, '_MEIPASS'))\n        else:\n            # others\n            lib_dir = Path(sys.executable).parent / 'lib'\n\n        path = lib_dir.joinpath(*module.__package__.split(\".\"))\n    else:\n        # unfrozen\n        path = Path(module.__file__).parent\n    return path\n\n\ndef list_module(module: ModuleType) -> List[str]:\n    path = get_path(module)\n\n    if getattr(sys, '_MEIPASS', False):\n        # PyInstaller\n        return [file.parent.name for file in Path(path).glob('*/__init__.py')]\n    else:\n        return [name for _, name, is_pkg in pkgutil.iter_modules([path]) if is_pkg]\n\n\ndef find_available_locales(providers: List[str]) -> List[str]:\n    available_locales: Set[str] = set()\n\n    for provider_path in providers:\n\n        provider_module = import_module(provider_path)\n        if getattr(provider_module, 'localized', False):\n            langs = list_module(provider_module)\n            available_locales.update(langs)\n    available_locales: List[str] = sorted(available_locales)\n    return available_locales\n\n\ndef find_available_providers(modules: List[ModuleType]) -> List[str]:\n    available_providers = set()\n    for providers_mod in modules:\n        if providers_mod.__package__:\n            providers = [\n                '.'.join([providers_mod.__package__, mod])\n                for mod in list_module(providers_mod) if mod != '__pycache__'\n            ]\n            available_providers.update(providers)\n    return sorted(available_providers)\n", "path": "faker/utils/loading.py"}]}