- changed status to open
Logging errors
Issue #12
resolved
Sometimes I have this error.
> PROJECT
--> Project Folder:
> Test_pyWaPOR
--> Period:
> 2022-10-01 00:00:00 - 2022-10-02 00:00:00
--> Bounding-Box:
14.3488
┌─────────┐
│ │
33.1479 │ │ 33.2875
│ │
└─────────┘
14.2657
--> Configuration:
> None
--> pyWaPOR Version:
> 3.5.5
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\logging\__init__.py", line 1086, in emit
stream.write(msg + self.terminator)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 223-233: character maps to <undefined>
Call stack:
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel_launcher.py", line 18, in <module>
app.launch_new_instance()
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\traitlets\config\application.py", line 1075, in launch_instance
app.start()
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel\kernelapp.py", line 739, in start
self.io_loop.start()
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\tornado\platform\asyncio.py", line 205, in start
self.asyncio_loop.run_forever()
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\asyncio\base_events.py", line 601, in run_forever
self._run_once()
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\asyncio\base_events.py", line 1905, in _run_once
handle._run()
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel\kernelbase.py", line 545, in dispatch_queue
await self.process_one()
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel\kernelbase.py", line 534, in process_one
await dispatch(*args)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel\kernelbase.py", line 437, in dispatch_shell
await result
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel\ipkernel.py", line 362, in execute_request
await super().execute_request(stream, ident, parent)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel\kernelbase.py", line 778, in execute_request
reply_content = await reply_content
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel\ipkernel.py", line 449, in do_execute
res = shell.run_cell(
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\ipykernel\zmqshell.py", line 549, in run_cell
return super().run_cell(*args, **kwargs)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\IPython\core\interactiveshell.py", line 3048, in run_cell
result = self._run_cell(
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\IPython\core\interactiveshell.py", line 3103, in _run_cell
result = runner(coro)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\IPython\core\async_helpers.py", line 129, in _pseudo_sync_runner
coro.send(None)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\IPython\core\interactiveshell.py", line 3308, in run_cell_async
has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\IPython\core\interactiveshell.py", line 3490, in run_ast_nodes
if await self.run_code(code, result, async_=asy):
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\IPython\core\interactiveshell.py", line 3550, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "C:\Users\ntr002\AppData\Local\Temp\ipykernel_27916\2852185676.py", line 5, in <module>
project = pywapor.Project(project_folder, bb, period)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\pywapor\main.py", line 455, in __init__
log.info(self.__repr__())
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\pywapor\general\log_indenter.py", line 496, in info
super(IndentedLoggerAdapter, self).info(msg, *args, **kwargs)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\logging\__init__.py", line 1806, in info
self.log(INFO, msg, *args, **kwargs)
File "C:\Users\ntr002\Miniconda3\envs\pywapor\lib\site-packages\pywapor\general\log_indenter.py", line 516, in log
super(IndentedLoggerAdapter, self).log(level, msg, *args, **kwargs)
Message: ' --> Project Folder:\n > Test_pyWaPOR\n --> Period:\n > 2022-10-01 00:00:00 - 2022-10-02 00:00:00\n --> Bounding-Box:\n\n 14.3488\n ┌─────────┐\n │ │\n 33.1479 │ │ 33.2875\n │ │\n └─────────┘\n 14.2657\n\n --> Configuration:\n > None\n --> pyWaPOR Version:\n > 3.5.5'
Arguments: ()
< PROJECT
It does not affect other steps, only the logging is not displayed and saved properly. The output log.txt does not have project information:
2024-06-10 16:26:01,883 INFO: > PROJECT
2024-06-10 16:26:01,939 INFO: < PROJECT
It seems like an issue with ipykernel, not sure how to fix. It’s trivial but might scare away new users 😅
How to reproduce the error
- Operating system: Windows 10
-
Environment:
conda create -n pywapor -c conda-forge pywapor jupyter notebook
Comments (4)
-
-
- changed status to resolved
Should be fixed by https://bitbucket.org/cioapps/pywapor/commits/3a077da07f8d0f4680fe2815bf85fdb98609d098
But I can't check it myself, so if you still encounter it (after updating) please let me know and I'll reopen.
-
- changed status to open
I still see this issue on many computers, so reopening..
-
- changed status to resolved
should be fixed now... (but can't check myself)
https://bitbucket.org/cioapps/pywapor/commits/03a687f692c4c4459b33427ebdbc6dd7b354833e
- Log in to comment
Thanks for pointing that out. Had a similar error in WaPORDL a while back (fixed here https://bitbucket.org/cioapps/wapordl/commits/300dffa49e6b5f17215bfceb7ac53b7a91b06f7b). So should be easy to fix this one.