prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  I can't compile my project by pyinstaller
  I have a script with code:
  ```
  from mimesis import Personal
  person = Personal('en')
  person.full_name()
  ```
  and it works well, but after compiling this code to .exe via pyinstaller I have an error **FileNotFoundError: [Errno 2] No such file or directory: 'B:\\_MEI131682\\mimesis\\data/es\\personal.json'
  [20624] Failed to execute script myproject**
  So, I think that problem in path (`data/es\\personal`). What ways of solving this problem can you recommend?
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mimesis/utils.py`
  Content:
  ```
  1 """This module is provide internal util functions."""
  2 
  3 import collections
  4 import functools
  5 import json
  6 import ssl
  7 from os import path
  8 from typing import Mapping, Optional, Union
  9 from urllib import request
  10 
  11 from mimesis import config
  12 from mimesis.exceptions import UnsupportedLocale
  13 from mimesis.typing import JSON
  14 
  15 __all__ = ['download_image', 'locale_info',
  16            'luhn_checksum', 'setup_locale', 'pull']
  17 
  18 DATA_DIR = path.abspath(path.join(path.dirname(__file__), 'data'))
  19 
  20 
  21 def locale_info(locale: str) -> str:
  22     """Check information about locale.
  23 
  24     :param locale: Locale abbreviation.
  25     :return: Locale name.
  26     :raises UnsupportedLocale: if locale is not supported.
  27     """
  28     locale = locale.lower()
  29     supported = config.SUPPORTED_LOCALES
  30 
  31     if locale not in supported:
  32         raise UnsupportedLocale(locale)
  33 
  34     return supported[locale]['name']
  35 
  36 
  37 def luhn_checksum(num: str) -> str:
  38     """Calculate a checksum for num using the Luhn algorithm.
  39 
  40     :param num: The number to calculate a checksum for as a string.
  41     :return: Checksum for number.
  42     """
  43     check = 0
  44     for i, s in enumerate(reversed(num)):
  45         sx = int(s)
  46         sx = sx * 2 if i % 2 == 0 else sx
  47         sx = sx - 9 if sx > 9 else sx
  48         check += sx
  49     return str(check * 9 % 10)
  50 
  51 
  52 def update_dict(initial: JSON, other: Mapping) -> JSON:
  53     """Recursively update a dictionary.
  54 
  55     :param initial: Dict to update.
  56     :type initial: dict or list
  57     :param other: Dict to update from.
  58     :type other: Mapping
  59     :return: Updated dict.
  60     :rtype: dict
  61     """
  62     for key, value in other.items():
  63         if isinstance(value, collections.Mapping):
  64             r = update_dict(initial.get(key, {}), value)
  65             initial[key] = r
  66         else:
  67             initial[key] = other[key]
  68     return initial
  69 
  70 
  71 @functools.lru_cache(maxsize=None)
  72 def pull(file: str, locale: str = 'en') -> JSON:
  73     """Pull the content from the JSON and memorize one.
  74 
  75     Opens JSON file ``file`` in the folder ``data/locale``
  76     and get content from the file and memorize ones using lru_cache.
  77 
  78     :param file: The name of file.
  79     :param locale: Locale.
  80     :return: The content of the file.
  81     :rtype: dict
  82     :raises UnsupportedLocale: if locale is not supported.
  83 
  84     :Example:
  85 
  86         >>> from mimesis.utils import pull
  87         >>> en = pull(file='datetime.json', locale='en')
  88         >>> isinstance(en, dict)
  89         True
  90         >>> en['day']['abbr'][0]
  91         'Mon.'
  92     """
  93     def get_data(locale_name: str) -> JSON:
  94         """Pull JSON data from file.
  95 
  96         :param locale_name: Locale name.
  97         :return: Content of JSON file as dict.
  98         """
  99         file_path = path.join(DATA_DIR + '/' + locale_name, file)
  100         # Needs explicit encoding for Windows
  101         with open(file_path, 'r', encoding='utf8') as f:
  102             return json.load(f)
  103 
  104     locale = locale.lower()
  105 
  106     if locale not in config.SUPPORTED_LOCALES:
  107         raise UnsupportedLocale(locale)
  108 
  109     master_locale = locale.split('-')[0]
  110     data = get_data(master_locale)
  111 
  112     # Handle sub-locales
  113     if '-' in locale:
  114         data = update_dict(data, get_data(locale))
  115 
  116     return data
  117 
  118 
  119 def download_image(url: str = '', save_path: str = '',
  120                    unverified_ctx: bool = False) -> Union[None, str]:
  121     """Download image and save in current directory on local machine.
  122 
  123     :param url: URL to image.
  124     :param save_path: Saving path.
  125     :param unverified_ctx: Create unverified context.
  126     :return: Image name.
  127     :rtype: str or None
  128     """
  129     if unverified_ctx:
  130         ssl._create_default_https_context = ssl._create_unverified_context
  131 
  132     if url is not None:
  133         image_name = url.rsplit('/')[-1]
  134         request.urlretrieve(url, save_path + image_name)
  135         return image_name
  136     return None
  137 
  138 
  139 def setup_locale(locale: Optional[str] = None) -> str:
  140     """Set up locale after pre-check.
  141 
  142     :param str locale: Locale
  143     :return: Locale in lowercase.
  144     :raises UnsupportedLocale: if locales is not supported.
  145     """
  146     if not locale:
  147         return config.DEFAULT_LOCALE
  148 
  149     locale = locale.lower()
  150     if locale not in config.SUPPORTED_LOCALES:
  151         raise UnsupportedLocale(locale)
  152 
  153     return locale
  154
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/mimesis/utils.py b/mimesis/utils.py
  --- a/mimesis/utils.py
  +++ b/mimesis/utils.py
  @@ -96,7 +96,7 @@
           :param locale_name: Locale name.
           :return: Content of JSON file as dict.
           """
  -        file_path = path.join(DATA_DIR + '/' + locale_name, file)
  +        file_path = path.join(DATA_DIR, locale_name, file)
           # Needs explicit encoding for Windows
           with open(file_path, 'r', encoding='utf8') as f:
               return json.load(f)
  
verification_info: {"golden_diff": "diff --git a/mimesis/utils.py b/mimesis/utils.py\n--- a/mimesis/utils.py\n+++ b/mimesis/utils.py\n@@ -96,7 +96,7 @@\n         :param locale_name: Locale name.\n         :return: Content of JSON file as dict.\n         \"\"\"\n-        file_path = path.join(DATA_DIR + '/' + locale_name, file)\n+        file_path = path.join(DATA_DIR, locale_name, file)\n         # Needs explicit encoding for Windows\n         with open(file_path, 'r', encoding='utf8') as f:\n             return json.load(f)\n", "issue": "I can't compile my project by pyinstaller\nI have a script with code:\r\n```\r\nfrom mimesis import Personal\r\nperson = Personal('en')\r\nperson.full_name()\r\n```\r\nand it works well, but after compiling this code to .exe via pyinstaller I have an error **FileNotFoundError: [Errno 2] No such file or directory: 'B:\\\\_MEI131682\\\\mimesis\\\\data/es\\\\personal.json'\r\n[20624] Failed to execute script myproject**\r\nSo, I think that problem in path (`data/es\\\\personal`). What ways of solving this problem can you recommend?\n", "before_files": [{"content": "\"\"\"This module is provide internal util functions.\"\"\"\n\nimport collections\nimport functools\nimport json\nimport ssl\nfrom os import path\nfrom typing import Mapping, Optional, Union\nfrom urllib import request\n\nfrom mimesis import config\nfrom mimesis.exceptions import UnsupportedLocale\nfrom mimesis.typing import JSON\n\n__all__ = ['download_image', 'locale_info',\n           'luhn_checksum', 'setup_locale', 'pull']\n\nDATA_DIR = path.abspath(path.join(path.dirname(__file__), 'data'))\n\n\ndef locale_info(locale: str) -> str:\n    \"\"\"Check information about locale.\n\n    :param locale: Locale abbreviation.\n    :return: Locale name.\n    :raises UnsupportedLocale: if locale is not supported.\n    \"\"\"\n    locale = locale.lower()\n    supported = config.SUPPORTED_LOCALES\n\n    if locale not in supported:\n        raise UnsupportedLocale(locale)\n\n    return supported[locale]['name']\n\n\ndef luhn_checksum(num: str) -> str:\n    \"\"\"Calculate a checksum for num using the Luhn algorithm.\n\n    :param num: The number to calculate a checksum for as a string.\n    :return: Checksum for number.\n    \"\"\"\n    check = 0\n    for i, s in enumerate(reversed(num)):\n        sx = int(s)\n        sx = sx * 2 if i % 2 == 0 else sx\n        sx = sx - 9 if sx > 9 else sx\n        check += sx\n    return str(check * 9 % 10)\n\n\ndef update_dict(initial: JSON, other: Mapping) -> JSON:\n    \"\"\"Recursively update a dictionary.\n\n    :param initial: Dict to update.\n    :type initial: dict or list\n    :param other: Dict to update from.\n    :type other: Mapping\n    :return: Updated dict.\n    :rtype: dict\n    \"\"\"\n    for key, value in other.items():\n        if isinstance(value, collections.Mapping):\n            r = update_dict(initial.get(key, {}), value)\n            initial[key] = r\n        else:\n            initial[key] = other[key]\n    return initial\n\n\n@functools.lru_cache(maxsize=None)\ndef pull(file: str, locale: str = 'en') -> JSON:\n    \"\"\"Pull the content from the JSON and memorize one.\n\n    Opens JSON file ``file`` in the folder ``data/locale``\n    and get content from the file and memorize ones using lru_cache.\n\n    :param file: The name of file.\n    :param locale: Locale.\n    :return: The content of the file.\n    :rtype: dict\n    :raises UnsupportedLocale: if locale is not supported.\n\n    :Example:\n\n        >>> from mimesis.utils import pull\n        >>> en = pull(file='datetime.json', locale='en')\n        >>> isinstance(en, dict)\n        True\n        >>> en['day']['abbr'][0]\n        'Mon.'\n    \"\"\"\n    def get_data(locale_name: str) -> JSON:\n        \"\"\"Pull JSON data from file.\n\n        :param locale_name: Locale name.\n        :return: Content of JSON file as dict.\n        \"\"\"\n        file_path = path.join(DATA_DIR + '/' + locale_name, file)\n        # Needs explicit encoding for Windows\n        with open(file_path, 'r', encoding='utf8') as f:\n            return json.load(f)\n\n    locale = locale.lower()\n\n    if locale not in config.SUPPORTED_LOCALES:\n        raise UnsupportedLocale(locale)\n\n    master_locale = locale.split('-')[0]\n    data = get_data(master_locale)\n\n    # Handle sub-locales\n    if '-' in locale:\n        data = update_dict(data, get_data(locale))\n\n    return data\n\n\ndef download_image(url: str = '', save_path: str = '',\n                   unverified_ctx: bool = False) -> Union[None, str]:\n    \"\"\"Download image and save in current directory on local machine.\n\n    :param url: URL to image.\n    :param save_path: Saving path.\n    :param unverified_ctx: Create unverified context.\n    :return: Image name.\n    :rtype: str or None\n    \"\"\"\n    if unverified_ctx:\n        ssl._create_default_https_context = ssl._create_unverified_context\n\n    if url is not None:\n        image_name = url.rsplit('/')[-1]\n        request.urlretrieve(url, save_path + image_name)\n        return image_name\n    return None\n\n\ndef setup_locale(locale: Optional[str] = None) -> str:\n    \"\"\"Set up locale after pre-check.\n\n    :param str locale: Locale\n    :return: Locale in lowercase.\n    :raises UnsupportedLocale: if locales is not supported.\n    \"\"\"\n    if not locale:\n        return config.DEFAULT_LOCALE\n\n    locale = locale.lower()\n    if locale not in config.SUPPORTED_LOCALES:\n        raise UnsupportedLocale(locale)\n\n    return locale\n", "path": "mimesis/utils.py"}], "after_files": [{"content": "\"\"\"This module is provide internal util functions.\"\"\"\n\nimport collections\nimport functools\nimport json\nimport ssl\nfrom os import path\nfrom typing import Mapping, Optional, Union\nfrom urllib import request\n\nfrom mimesis import config\nfrom mimesis.exceptions import UnsupportedLocale\nfrom mimesis.typing import JSON\n\n__all__ = ['download_image', 'locale_info',\n           'luhn_checksum', 'setup_locale', 'pull']\n\nDATA_DIR = path.abspath(path.join(path.dirname(__file__), 'data'))\n\n\ndef locale_info(locale: str) -> str:\n    \"\"\"Check information about locale.\n\n    :param locale: Locale abbreviation.\n    :return: Locale name.\n    :raises UnsupportedLocale: if locale is not supported.\n    \"\"\"\n    locale = locale.lower()\n    supported = config.SUPPORTED_LOCALES\n\n    if locale not in supported:\n        raise UnsupportedLocale(locale)\n\n    return supported[locale]['name']\n\n\ndef luhn_checksum(num: str) -> str:\n    \"\"\"Calculate a checksum for num using the Luhn algorithm.\n\n    :param num: The number to calculate a checksum for as a string.\n    :return: Checksum for number.\n    \"\"\"\n    check = 0\n    for i, s in enumerate(reversed(num)):\n        sx = int(s)\n        sx = sx * 2 if i % 2 == 0 else sx\n        sx = sx - 9 if sx > 9 else sx\n        check += sx\n    return str(check * 9 % 10)\n\n\ndef update_dict(initial: JSON, other: Mapping) -> JSON:\n    \"\"\"Recursively update a dictionary.\n\n    :param initial: Dict to update.\n    :type initial: dict or list\n    :param other: Dict to update from.\n    :type other: Mapping\n    :return: Updated dict.\n    :rtype: dict\n    \"\"\"\n    for key, value in other.items():\n        if isinstance(value, collections.Mapping):\n            r = update_dict(initial.get(key, {}), value)\n            initial[key] = r\n        else:\n            initial[key] = other[key]\n    return initial\n\n\n@functools.lru_cache(maxsize=None)\ndef pull(file: str, locale: str = 'en') -> JSON:\n    \"\"\"Pull the content from the JSON and memorize one.\n\n    Opens JSON file ``file`` in the folder ``data/locale``\n    and get content from the file and memorize ones using lru_cache.\n\n    :param file: The name of file.\n    :param locale: Locale.\n    :return: The content of the file.\n    :rtype: dict\n    :raises UnsupportedLocale: if locale is not supported.\n\n    :Example:\n\n        >>> from mimesis.utils import pull\n        >>> en = pull(file='datetime.json', locale='en')\n        >>> isinstance(en, dict)\n        True\n        >>> en['day']['abbr'][0]\n        'Mon.'\n    \"\"\"\n    def get_data(locale_name: str) -> JSON:\n        \"\"\"Pull JSON data from file.\n\n        :param locale_name: Locale name.\n        :return: Content of JSON file as dict.\n        \"\"\"\n        file_path = path.join(DATA_DIR, locale_name, file)\n        # Needs explicit encoding for Windows\n        with open(file_path, 'r', encoding='utf8') as f:\n            return json.load(f)\n\n    locale = locale.lower()\n\n    if locale not in config.SUPPORTED_LOCALES:\n        raise UnsupportedLocale(locale)\n\n    master_locale = locale.split('-')[0]\n    data = get_data(master_locale)\n\n    # Handle sub-locales\n    if '-' in locale:\n        data = update_dict(data, get_data(locale))\n\n    return data\n\n\ndef download_image(url: str = '', save_path: str = '',\n                   unverified_ctx: bool = False) -> Union[None, str]:\n    \"\"\"Download image and save in current directory on local machine.\n\n    :param url: URL to image.\n    :param save_path: Saving path.\n    :param unverified_ctx: Create unverified context.\n    :return: Image name.\n    :rtype: str or None\n    \"\"\"\n    if unverified_ctx:\n        ssl._create_default_https_context = ssl._create_unverified_context\n\n    if url is not None:\n        image_name = url.rsplit('/')[-1]\n        request.urlretrieve(url, save_path + image_name)\n        return image_name\n    return None\n\n\ndef setup_locale(locale: Optional[str] = None) -> str:\n    \"\"\"Set up locale after pre-check.\n\n    :param str locale: Locale\n    :return: Locale in lowercase.\n    :raises UnsupportedLocale: if locales is not supported.\n    \"\"\"\n    if not locale:\n        return config.DEFAULT_LOCALE\n\n    locale = locale.lower()\n    if locale not in config.SUPPORTED_LOCALES:\n        raise UnsupportedLocale(locale)\n\n    return locale\n", "path": "mimesis/utils.py"}]}