fido icon indicating copy to clipboard operation
fido copied to clipboard

Migrate from 1.4.1 to 1.6.1 : FileNotFoundError: [Errno 2] No such file or directory: '.../fido/conf/formats-v104.xml'

Open pulse-mind opened this issue 2 years ago • 11 comments

Hello,

I am using django and I migrate from 1.4.1 to 1.6.0. I have this error :

FileNotFoundError: [Errno 2] No such file or directory: '/Users/pmind/.virtualenvs/myproject/lib/python3.10/site-packages/fido/conf/formats-v104.xml'

In https://github.com/openpreserve/fido/tree/master/fido/conf there is only formats-v109.xml

Would you like to help me about that please ?

Best regards, Fred

pulse-mind avatar Mar 07 '23 17:03 pulse-mind

Hi @pulse-mind, sorry to hear you have issues. Could you try issuing this command and see what happens please?

fido -sigs update

I'll look into what might be a packaging issue in the coming two weeks.

carlwilson avatar Mar 09 '23 14:03 carlwilson

Hi @carlwilson , thank you for your reply. I'am not sure to understand properly your request. So this is what I've done :

  • In my python virtual env used in Django
  • type your command fido -sigs update
  • The result is :
fido -sigs update
usage: fido [-h] [-v] [-q] [-recurse] [-zip] [-noextension] [-nocontainer] [-pronom_only] [-input INPUT] [-filename FILENAME]
            [-useformats INCLUDEPUIDS] [-nouseformats EXCLUDEPUIDS] [-matchprintf FORMATSTRING] [-nomatchprintf FORMATSTRING] [-bufsize BUFSIZE]
            [-container_bufsize CONTAINER_BUFSIZE] [-loadformats XML1,...,XMLn] [-confdir CONFDIR]
            [FILE ...]
fido: error: unrecognized arguments: -sigs

For your information I'm working on MACOS (latest version) - Apple chip.

pulse-mind avatar Mar 09 '23 15:03 pulse-mind

Hi @pulse-mind , it's not clear to me that you are running v1.6 of Fido which I suspect is the problem. Here's the output from a fresh virtualenv install on my workstation:

fido -v
zsh: correct 'fido' to 'id' [nyae]? n
FIDO v1.6.1 (formats-v109.xml, container-signature-20200121.xml, format_extensions.xml)
❯ fido -h
usage: fido [-h] [-v] [-q] [-recurse] [-zip] [-noextension] [-nocontainer] [-pronom_only] [-input INPUT] [-filename FILENAME] [-useformats INCLUDEPUIDS] [-nouseformats EXCLUDEPUIDS]
            [-matchprintf FORMATSTRING] [-nomatchprintf FORMATSTRING] [-bufsize BUFSIZE] [-sigs SIG_ACT] [-container_bufsize CONTAINER_BUFSIZE] [-loadformats XML1,...,XMLn]
            [-confdir CONFDIR]
            [FILE ...]

Note the -sigs option in the help output. Please just try a fido -v and check/paste the output please.

carlwilson avatar Mar 24 '23 11:03 carlwilson

Hi @carlwilson Thank you for your reply and the time spent on it.

I start with a fresh virtualenv using 1.4.1 and then running the install requirements with 1.6.0 and this is the output (I probably did not take care about last time):

WARNING: The candidate selected for download or install is a yanked version: 'opf-fido' candidate (version 1.6.0 at https://files.pythonhosted.org/packages/7f/2e/77ea6a904ea150159a0afdf7f36246d20f488b2b7ad54a2915e435b0751c/opf_fido-1.6.0-py2.py3-none-any.whl (from https://pypi.org/simple/opf-fido/))
Reason for being yanked: Incorrect packaging
Installing collected packages: importlib-resources, opf-fido
  Attempting uninstall: opf-fido
    Found existing installation: opf-fido 1.4.1
    Uninstalling opf-fido-1.4.1:
      Successfully uninstalled opf-fido-1.4.1
Successfully installed importlib-resources-5.12.0 opf-fido-1.6.0

I never had this kind of warning in the past. If I do a pip listI have opf-fido 1.6.0

And now if I do fido -v :

(myproject) ➜ myproject git:(master) ✗ fido -v
FIDO v1.6.0 (formats-v109.xml, container-signature-20200121.xml, format_extensions.xml)

And then ```fido -h````

fido -h
usage: fido [-h] [-v] [-q] [-recurse] [-zip] [-noextension] [-nocontainer] [-pronom_only] [-input INPUT] [-filename FILENAME]
            [-useformats INCLUDEPUIDS] [-nouseformats EXCLUDEPUIDS] [-matchprintf FORMATSTRING] [-nomatchprintf FORMATSTRING] [-bufsize BUFSIZE]
            [-sigs SIG_ACT] [-container_bufsize CONTAINER_BUFSIZE] [-loadformats XML1,...,XMLn] [-confdir CONFDIR]
            [FILE ...]

And finally fido -sigs update that was not working last time which is working now...

fido -sigs update
Your signature files are up to date, current version is v109

At the end I still have the same Error

FileNotFoundError: [Errno 2] No such file or directory: '/Users/pmind/.virtualenvs/myproject/lib/python3.10/site-packages/fido/conf/formats-v104.xml'

pulse-mind avatar Mar 24 '23 13:03 pulse-mind

Thanks for that detailed feedback. That's enough for me to do a little more investigation. It will be next week when I get back to you with some progress hopefully.

carlwilson avatar Mar 24 '23 13:03 carlwilson

Hi @carlwilson did you find the time to investigate ?

pulse-mind avatar May 30 '23 14:05 pulse-mind

Hi @pulse-mind, apologies for the time taken. Could you please let me know your Python and Pip versions please?

❯ python --version
Python 3.11.3
❯ pip --version
pip 23.1.2 from .venvs/fido/lib/python3.11/site-packages/pip (python 3.11)

carlwilson avatar Jun 13 '23 10:06 carlwilson

Hello,

At this day :

> python --version
Python 3.10.4
> pip --version
pip 23.1.2 from /Users/.../.virtualenvs/.../lib/python3.10/site-packages/pip (python 3.10)

I think it was the same few weeks or month ago except minor version.

pulse-mind avatar Jun 13 '23 11:06 pulse-mind

Hi @carlwilson

Did you find the time to investigate ?

Have a good day. Fred

pulse-mind avatar Oct 04 '23 12:10 pulse-mind

Hi @carlwilson , Any chance for an investigation on this issue ?

pulse-mind avatar Apr 30 '24 14:04 pulse-mind

@carlwilson In fido.py, the defaults contains v104 instead of v109

defaults = {
    'bufsize': 128 * 1024,  # (bytes)
    'regexcachesize': 2084,  # (bytes)
    'printmatch': "OK,%(info.time)s,%(info.puid)s,\"%(info.formatname)s\",\"%(info.signaturename)s\",%(info.filesize)s,\"%(info.filename)s\",\"%(info.mimetype)s\",\"%(info.matchtype)s\"\n",
    'printnomatch': "KO,%(info.time)s,,,,%(info.filesize)s,\"%(info.filename)s\",,\"%(info.matchtype)s\"\n",
    'format_files': [
        'formats-v104.xml',
        'format_extensions.xml'
    ],

Instead of

defaults = {
    'bufsize': 128 * 1024,  # (bytes)
    'regexcachesize': 2084,  # (bytes)
    'printmatch': "OK,%(info.time)s,%(info.puid)s,\"%(info.formatname)s\",\"%(info.signaturename)s\",%(info.filesize)s,\"%(info.filename)s\",\"%(info.mimetype)s\",\"%(info.matchtype)s\"\n",
    'printnomatch': "KO,%(info.time)s,,,,%(info.filesize)s,\"%(info.filename)s\",,\"%(info.matchtype)s\"\n",
    'format_files': [
        'formats-v109.xml',
        'format_extensions.xml'
    ],

If I modify this it works fine.

Do you want me to do a pull request for this ?

pulse-mind avatar Jun 05 '24 08:06 pulse-mind

I've merged this at last @pulse-mind apologies, I've been stretched too thin over too many things and somethings had to give. We will endeavour to get a release out soon.

carlwilson avatar Sep 02 '24 15:09 carlwilson

Thank you, have a good day.

pulse-mind avatar Sep 02 '24 15:09 pulse-mind