Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Crashes with Chrome #2

Open
ns-rse opened this issue May 26, 2023 · 1 comment
Open

Crashes with Chrome #2

ns-rse opened this issue May 26, 2023 · 1 comment

Comments

@ns-rse
Copy link
Contributor

ns-rse commented May 26, 2023

Possible caching errors with Chrome on Windows...

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[2], line 12
      9 from ipysheet import from_dataframe
     10 import pandas as pd
---> 12 from pgfinder import matching, pgio, validation
     14 # Get list of modifications
     15 allowed_mods = validation.allowed_modifications()

File /lib/python3.11/site-packages/pgfinder/__init__.py:6
      4 import yaml
      5 from pkgutil import get_data
----> 6 from pgfinder.logs.logs import setup_logger, LOGGER_NAME
      7 from pgfinder.utils import dict_to_decimal
      9 LOGGER = setup_logger()

File /lib/python3.11/site-packages/pgfinder/logs/logs.py:12
      9 # pylint: disable=assignment-from-no-return
     11 start = datetime.now()
---> 12 LOG_CONFIG = logging.basicConfig(
     13     filename=Path().cwd().stem +
f"-{start.strftime('%Y-%m-%d-%H-%M-%S')}.log", filemode="w"
     14 )
     15 LOG_FORMATTER = logging.Formatter(
     16     fmt="[%(asctime)s] [%(levelname)-8s] [%(name)s]
%(message)s", datefmt="%a, %d %b %Y %H:%M:%S"
     17 )
     18 LOG_ERROR_FORMATTER = logging.Formatter(
     19     fmt="[%(asctime)s] [%(levelname)-8s] [%(name)s]
[%(filename)s] [%(lineno)s] %(message)s",
     20     datefmt="%a, %d %b %Y %H:%M:%S",
     21 )

File /lib/python311.zip/logging/__init__.py:2050, in basicConfig(**kwargs)
   2048     else:
   2049         encoding = io.text_encoding(encoding)
-> 2050     h = FileHandler(filename, mode,
   2051                     encoding=encoding, errors=errors)
   2052 else:
   2053     stream = kwargs.pop("stream", None)

File /lib/python311.zip/logging/__init__.py:1181, in
FileHandler.__init__(self, filename, mode, encoding, delay, errors)
   1179     self.stream = None
   1180 else:
-> 1181     StreamHandler.__init__(self, self._open())

File /lib/python311.zip/logging/__init__.py:1213, in FileHandler._open(self)
   1208 """
   1209 Open the current base file with the (original) mode and encoding.
   1210 Return the resulting stream.
   1211 """
   1212 open_func = self._builtin_open
-> 1213 return open_func(self.baseFilename, self.mode,
   1214                  encoding=self.encoding, errors=self.errors)

OSError: [Errno 28] Invalid argument: '/drive/drive-2023-05-26-08-46-16.log'

Related JupyterLite issues...

PR pgfinder #161 disables logging in __init__.py and only sets up a logger in find_pg.py. An alpha release has been made (v0.0.3-a3) which was built from this commit and it runs ok under Firefox and Opera (GNU/Linux) both locally and from the built GitHub pages.

@TheLostLambda
Copy link
Member

For what it's worth, I read somewhere about injecting some Javascript into the notebook (one of the HTML elements) to automate clearing of the IndexedDB (which I think might be the source of problems here), but if it's a different type of caching, maybe there is a JS interface for that as well?

jupyterlite/jupyterlite#407 (comment)

Let me know if you find that useful or if targeting the IndexedDB helps any (since that seems to escape some normal cache clearing on Firefox anyhow)!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants