Pete R Jemian
Pete R Jemian
example ```py (bluesky_2024_2) prjemian@arf:~/Bluesky_RunEngine_md$ ipython Python 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:53:32) [GCC 12.3.0] Type 'copyright', 'credits' or 'license' for more information IPython 8.22.2 --...
Contents of this directory: [RE_md_persistent_dict.zip](https://github.com/bluesky/bluesky/files/15179985/RE_md_persistent_dict.zip)
Problem appears to arise in upstream *zict* package: ```py In [11]: import zict In [12]: zf = zict.File(".") In [16]: dict(zf) --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[16],...
Here's the troublemaker (called from zict/file.py line 81 above). I call it directly with the desired `versions#30` file name: ```py In [23]: zict.file._safe_key("versions#30") Out[23]: 'versions%2330' ``` In turn, this relies...
Since this is a file name, not a URL, is `urllib.parse.quote()` being abused here? The argument to `PersistentDict()` is named `directory`. It should not be cleaned up as if it...
If we wrap this code with `try..except FileNotFoundError`: https://github.com/bluesky/bluesky/blob/add624e1b7f03c9b4b981e78dfc2333ed01e1f0c/src/bluesky/utils/__init__.py#L810C9-L811C1 What do we do in the exception handling? Report, then erase the directory? Seems brutal.
A less brutal correction might be to remove the `#*` suffixes. That seems to to be the pattern that triggers the exception.
Once the files ending with the suffix `#n` (where n is an integer) have been stripped of their suffixes, `zict.File(".")` opens the directory successfully. ```py In [5]: zf = zict.File(".")...
I'm suggesting that the caller can choose to clean up the directory before calling `PersistentDict()directory)`. This problem will not need further handling in this code base.
I added an issue to the governance repo