iyaja / llama-fs

A self-organizing file system with llama 3
MIT License
4.49k stars 259 forks source link

Unicode Undefined Error #34

Open Haard-Shah opened 4 weeks ago

Haard-Shah commented 4 weeks ago

After running the install scripts and running the server as suggested in ReadME.md file I ran into the following error:

UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f40d' in position 0: character maps to <undefined>

Here is the output log to help identify where the issue maybe steming from.

INFO     Using path server.py
INFO     Resolved absolute path C:\Users\haard\Documents -
         Local\Projects\llama-fs\server.py
INFO     Searching for package file structure from directories with __init__.py
         files
INFO     Importing from C:\Users\haard\Documents - Local\Projects\llama-fs

 +- Python module file -+
 |                      |
 |  +--------------------- Traceback (most recent call last) ---------------------+
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\fa |
| stapi_cli\cli.py:174 in dev                                                 |
|                                                                             |
|   171                                                                       |
|   172     Otherwise, it uses the first [bold]FastAPI[/bold] app found in th |
|   173     """                                                               |
| > 174     _run(                                                             |
|   175         path=path,                                                    |
|   176         host=host,                                                    |
|   177         port=port,                                                    |
|                                                                             |
| +----------------- locals -----------------+                                |
| |           app = None                     |                                |
| |          host = '127.0.0.1'              |                                |
| |          path = WindowsPath('server.py') |                                |
| |          port = 8000                     |                                |
| | proxy_headers = True                     |                                |
| |        reload = True                     |                                |
| |     root_path = ''                       |                                |
| +------------------------------------------+                                |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\fa |
| stapi_cli\cli.py:65 in _run                                                 |
|                                                                             |
|    62     proxy_headers: bool = False,                                      |
|    63 ) -> None:                                                            |
|    64     try:                                                              |
| >  65         use_uvicorn_app = get_import_string(path=path, app_name=app)  |
|    66     except FastAPICLIException as e:                                  |
|    67         logger.error(str(e))                                          |
|    68         raise typer.Exit(code=1) from None                            |
|                                                                             |
| +----------------- locals -----------------+                                |
| |           app = None                     |                                |
| |       command = 'dev'                    |                                |
| |          host = '127.0.0.1'              |                                |
| |          path = WindowsPath('server.py') |                                |
| |          port = 8000                     |                                |
| | proxy_headers = True                     |                                |
| |        reload = True                     |                                |
| |     root_path = ''                       |                                |
| |       workers = None                     |                                |
| +------------------------------------------+                                |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\fa |
| stapi_cli\discover.py:152 in get_import_string                              |
|                                                                             |
|   149     logger.info(f"Resolved absolute path {path.resolve()}")           |
|   150     if not path.exists():                                             |
|   151         raise FastAPICLIException(f"Path does not exist {path}")      |
| > 152     mod_data = get_module_data_from_path(path)                        |
|   153     sys.path.insert(0, str(mod_data.extra_sys_path))                  |
|   154     use_app_name = get_app_name(mod_data=mod_data, app_name=app_name) |
|   155     import_example = Syntax(                                          |
|                                                                             |
| +-------------- locals ---------------+                                     |
| | app_name = None                     |                                     |
| |     path = WindowsPath('server.py') |                                     |
| +-------------------------------------+                                     |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\fa |
| stapi_cli\discover.py:97 in get_module_data_from_path                       |
|                                                                             |
|    94         ),                                                            |
|    95         1,                                                            |
|    96     )                                                                 |
| >  97     print(panel)                                                      |
|    98     module_str = ".".join(p.stem for p in module_paths)               |
|    99     logger.info(f"Importing module [green]{module_str}[/green]")      |
|   100     return ModuleData(                                                |
|                                                                             |
| +-------------------------------- locals ---------------------------------+ |
| | extra_sys_path = WindowsPath('C:/Users/haard/Documents -                | |
| |                  Local/Projects/llama-fs')                              | |
| |      init_path = WindowsPath('C:/Users/haard/Documents -                | |
| |                  Local/Projects/llama-fs/__init__.py')                  | |
| |    module_path = WindowsPath('C:/Users/haard/Documents -                | |
| |                  Local/Projects/llama-fs/server.py')                    | |
| |   module_paths = [                                                      | |
| |                      WindowsPath('C:/Users/haard/Documents -            | |
| |                  Local/Projects/llama-fs/server.py')                    | |
| |                  ]                                                      | |
| |           name = '\U0001f40d server.py'                                         | |
| |          panel = Padding(<rich.panel.Panel object at                    | |
| |                  0x000001D54C89F650>, (1,1,1,1))                        | |
| |         parent = WindowsPath('C:/Users/haard/Documents -                | |
| |                  Local/Projects/llama-fs')                              | |
| |           path = WindowsPath('server.py')                               | |
| |           root = WindowsPath('C:/Users/haard/Documents -                | |
| |                  Local/Projects/llama-fs/server.py')                    | |
| |      root_tree = <rich.tree.Tree object at 0x000001D547A64DD0>          | |
| |          title = '[b green]Python module file[/b green]'                | |
| |           tree = <rich.tree.Tree object at 0x000001D547A64DD0>          | |
| |       use_path = WindowsPath('C:/Users/haard/Documents -                | |
| |                  Local/Projects/llama-fs/server.py')                    | |
| +-------------------------------------------------------------------------+ |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\ri |
| ch\__init__.py:74 in print                                                  |
|                                                                             |
|    71     from .console import Console                                      |
|    72                                                                       |
|    73     write_console = get_console() if file is None else Console(file=f |
| >  74     return write_console.print(*objects, sep=sep, end=end)            |
|    75                                                                       |
|    76                                                                       |
|    77 def print_json(                                                       |
|                                                                             |
| +-------------------------------- locals ---------------------------------+ |
| |       Console = <class 'rich.console.Console'>                          | |
| |           end = '\n'                                                    | |
| |          file = None                                                    | |
| |         flush = False                                                   | |
| |       objects = (                                                       | |
| |                     Padding(<rich.panel.Panel object at                 | |
| |                 0x000001D54C89F650>, (1,1,1,1)),                        | |
| |                 )                                                       | |
| |           sep = ' '                                                     | |
| | write_console = <console width=79 None>                                 | |
| +-------------------------------------------------------------------------+ |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\ri |
| ch\console.py:1673 in print                                                 |
|                                                                             |
|   1670                 overflow = "ignore"                                  |
|   1671             crop = False                                             |
|   1672         render_hooks = self._render_hooks[:]                         |
| > 1673         with self:                                                   |
|   1674             renderables = self._collect_renderables(                 |
|   1675                 objects,                                             |
|   1676                 sep,                                                 |
|                                                                             |
| +-------------------------------- locals ---------------------------------+ |
| |  buffer_extend = <built-in method extend of list object at              | |
| |                  0x000001D54C3BF200>                                    | |
| |           crop = True                                                   | |
| |          emoji = None                                                   | |
| |            end = '\n'                                                   | |
| |         extend = <built-in method extend of list object at              | |
| |                  0x000001D54C8996C0>                                    | |
| |         height = None                                                   | |
| |      highlight = None                                                   | |
| |        justify = None                                                   | |
| |           line = [                                                      | |
| |                      Segment(                                           | |
| |                          '                                              | |
| |                  ',                                                     | |
| |                          Style()                                        | |
| |                      ),                                                 | |
| |                      Segment('\n')                                      | |
| |                  ]                                                      | |
| |         markup = None                                                   | |
| | new_line_start = False                                                  | |
| |   new_segments = [                                                      | |
| |                      Segment(                                           | |
| |                          '                                              | |
| |                  \n',                                                   | |
| |                          Style()                                        | |
| |                      ),                                                 | |
| |                      Segment(' ', Style()),                             | |
| |                      Segment('+-', Style()),                            | |
| |                      Segment(' ', Style()),                             | |
| |                      Segment(                                           | |
| |                          'Python module file',                          | |
| |                          Style(                                         | |
| |                              color=Color(                               | |
| |                                  'green',                               | |
| |                                  ColorType.STANDARD,                    | |
| |                                  number=2                               | |
| |                              ),                                         | |
| |                              bold=True                                  | |
| |                          )                                              | |
| |                      ),                                                 | |
| |                      Segment(' ', Style()),                             | |
| |                      Segment('-+', Style()),                            | |
| |                      Segment(                                           | |
| |                          '                                              | |
| |                  ',                                                     | |
| |                          Style()                                        | |
| |                      ),                                                 | |
| |                      Segment(' ', Style()),                             | |
| |                      Segment('\n'),                                     | |
| |                      ... +30                                            | |
| |                  ]                                                      | |
| |        no_wrap = None                                                   | |
| |        objects = (                                                      | |
| |                      Padding(<rich.panel.Panel object at                | |
| |                  0x000001D54C89F650>, (1,1,1,1)),                       | |
| |                  )                                                      | |
| |       overflow = None                                                   | |
| |         render = <bound method Console.render of <console width=79      | |
| |                  None>>                                                 | |
| |   render_hooks = []                                                     | |
| | render_options = ConsoleOptions(                                        | |
| |                      size=ConsoleDimensions(width=79, height=25),       | |
| |                      legacy_windows=True,                               | |
| |                      min_width=1,                                       | |
| |                      max_width=79,                                      | |
| |                      is_terminal=False,                                 | |
| |                      encoding='cp1252',                                 | |
| |                      max_height=25,                                     | |
| |                      justify=None,                                      | |
| |                      overflow=None,                                     | |
| |                      no_wrap=None,                                      | |
| |                      highlight=None,                                    | |
| |                      markup=None,                                       | |
| |                      height=None                                        | |
| |                  )                                                      | |
| |     renderable = Padding(<rich.panel.Panel object at                    | |
| |                  0x000001D54C89F650>, (1,1,1,1))                        | |
| |    renderables = [                                                      | |
| |                      Padding(<rich.panel.Panel object at                | |
| |                  0x000001D54C89F650>, (1,1,1,1))                        | |
| |                  ]                                                      | |
| |           self = <console width=79 None>                                | |
| |            sep = ' '                                                    | |
| |      soft_wrap = False                                                  | |
| |          style = None                                                   | |
| |          width = None                                                   | |
| +-------------------------------------------------------------------------+ |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\ri |
| ch\console.py:865 in __exit__                                               |
|                                                                             |
|    862                                                                      |
|    863     def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any |
|    864         """Exit buffer context."""                                   |
| >  865         self._exit_buffer()                                          |
|    866                                                                      |
|    867     def begin_capture(self) -> None:                                 |
|    868         """Begin capturing console output. Call :meth:`end_capture`  |
|                                                                             |
| +-------------- locals ---------------+                                     |
| |  exc_type = None                    |                                     |
| | exc_value = None                    |                                     |
| |      self = <console width=79 None> |                                     |
| | traceback = None                    |                                     |
| +-------------------------------------+                                     |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\ri |
| ch\console.py:823 in _exit_buffer                                           |
|                                                                             |
|    820     def _exit_buffer(self) -> None:                                  |
|    821         """Leave buffer context, and render content if required."""  |
|    822         self._buffer_index -= 1                                      |
| >  823         self._check_buffer()                                         |
|    824                                                                      |
|    825     def set_live(self, live: "Live") -> None:                        |
|    826         """Set Live instance. Used by Live context manager.          |
|                                                                             |
| +------------ locals ------------+                                          |
| | self = <console width=79 None> |                                          |
| +--------------------------------+                                          |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\ri |
| ch\console.py:2027 in _check_buffer                                         |
|                                                                             |
|   2024                             if self.no_color and self._color_system: |
|   2025                                 buffer = list(Segment.remove_color(b |
|   2026                                                                      |
| > 2027                             legacy_windows_render(buffer, LegacyWind |
|   2028                         else:                                        |
|   2029                             # Either a non-std stream on legacy Wind |
|   2030                             text = self._render_buffer(self._buffer[ |
|                                                                             |
| +-------------------------------- locals ---------------------------------+ |
| |                    buffer = [                                           | |
| |                                 Segment(                                | |
| |                                     '                                   | |
| |                             ',                                          | |
| |                                     Style()                             | |
| |                                 ),                                      | |
| |                                 Segment('\n'),                          | |
| |                                 Segment(' ', Style()),                  | |
| |                                 Segment('+-', Style()),                 | |
| |                                 Segment(' ', Style()),                  | |
| |                                 Segment(                                | |
| |                                     'Python module file',               | |
| |                                     Style(                              | |
| |                                         color=Color(                    | |
| |                                             'green',                    | |
| |                                             ColorType.STANDARD,         | |
| |                                             number=2                    | |
| |                                         ),                              | |
| |                                         bold=True                       | |
| |                                     )                                   | |
| |                                 ),                                      | |
| |                                 Segment(' ', Style()),                  | |
| |                                 Segment('-+', Style()),                 | |
| |                                 Segment(                                | |
| |                                     '                                   | |
| |                             ',                                          | |
| |                                     Style()                             | |
| |                                 ),                                      | |
| |                                 Segment(' ', Style()),                  | |
| |                                 ... +32                                 | |
| |                             ]                                           | |
| |                    fileno = 1                                           | |
| |     legacy_windows_render = <function legacy_windows_render at          | |
| |                             0x000001D54C87AAC0>                         | |
| |         LegacyWindowsTerm = <class                                      | |
| |                             'rich._win32_console.LegacyWindowsTerm'>    | |
| |                      self = <console width=79 None>                     | |
| | use_legacy_windows_render = True                                        | |
| +-------------------------------------------------------------------------+ |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\ri |
| ch\_windows_renderer.py:19 in legacy_windows_render                         |
|                                                                             |
|   16             if style:                                                  |
|   17                 term.write_styled(text, style)                         |
|   18             else:                                                      |
| > 19                 term.write_text(text)                                  |
|   20         else:                                                          |
|   21             control_codes: Sequence[ControlCode] = control             |
|   22             for control_code in control_codes:                         |
|                                                                             |
| +-------------------------------- locals ---------------------------------+ |
| |  buffer = [                                                             | |
| |               Segment(                                                  | |
| |                   '                                                     | |
| |           ',                                                            | |
| |                   Style()                                               | |
| |               ),                                                        | |
| |               Segment('\n'),                                            | |
| |               Segment(' ', Style()),                                    | |
| |               Segment('+-', Style()),                                   | |
| |               Segment(' ', Style()),                                    | |
| |               Segment(                                                  | |
| |                   'Python module file',                                 | |
| |                   Style(                                                | |
| |                       color=Color(                                      | |
| |                           'green',                                      | |
| |                           ColorType.STANDARD,                           | |
| |                           number=2                                      | |
| |                       ),                                                | |
| |                       bold=True                                         | |
| |                   )                                                     | |
| |               ),                                                        | |
| |               Segment(' ', Style()),                                    | |
| |               Segment('-+', Style()),                                   | |
| |               Segment(                                                  | |
| |                   '                                                     | |
| |           ',                                                            | |
| |                   Style()                                               | |
| |               ),                                                        | |
| |               Segment(' ', Style()),                                    | |
| |               ... +32                                                   | |
| |           ]                                                             | |
| | control = None                                                          | |
| |   style = None                                                          | |
| |    term = <rich._win32_console.LegacyWindowsTerm object at              | |
| |           0x000001D54C898E90>                                           | |
| |    text = '\U0001f40d server.py'                                                | |
| +-------------------------------------------------------------------------+ |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\site-packages\ri |
| ch\_win32_console.py:403 in write_text                                      |
|                                                                             |
|   400         Args:                                                         |
|   401             text (str): The text to write to the console              |
|   402         """                                                           |
| > 403         self.write(text)                                              |
|   404         self.flush()                                                  |
|   405                                                                       |
|   406     def write_styled(self, text: str, style: Style) -> None:          |
|                                                                             |
| +-------------------------------- locals ---------------------------------+ |
| | self = <rich._win32_console.LegacyWindowsTerm object at                 | |
| |        0x000001D54C898E90>                                              | |
| | text = '\U0001f40d server.py'                                                   | |
| +-------------------------------------------------------------------------+ |
|                                                                             |
| C:\Users\haard\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252 |
| .py:19 in encode                                                            |
|                                                                             |
|    16                                                                       |
|    17 class IncrementalEncoder(codecs.IncrementalEncoder):                  |
|    18     def encode(self, input, final=False):                             |
| >  19         return codecs.charmap_encode(input,self.errors,encoding_table |
|    20                                                                       |
|    21 class IncrementalDecoder(codecs.IncrementalDecoder):                  |
|    22     def decode(self, input, final=False):                             |
|                                                                             |
| +-------------------------------- locals ---------------------------------+ |
| | final = False                                                           | |
| | input = '\U0001f40d server.py'                                                  | |
| |  self = <encodings.cp1252.IncrementalEncoder object at                  | |
| |         0x000001D547905650>                                             | |
| +-------------------------------------------------------------------------+ |
+-----------------------------------------------------------------------------+
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f40d' in
position 0: character maps to <undefined>

Thank you for your contributions and I am looking forward to exploring the LlamaFS.

Haard-Shah commented 4 weeks ago

It seems to work when using the git bash terminal system. I am quite new to development and so if you have any tips on why this would be the case then it would be great.