joeyespo/grip

grip reports not finding README (but does not try to open that file)

cdwijs opened this issue · 0 comments

To reproduce:

  1. install grip
    $ pip install grip
  2. add grip to the path
    $ nano ~/.bash_profile
    $ cat /.bash_profile
    export PATH=$PATH:
    /.local/bin
    $ source ~/.bash_profile
  3. clone the pulseview repository
    $ git clone git://sigrok.org/pulseview
    $ cd pulseview/
    $ ls -l README
    -rw-r--r-- 1 cedric cedric 3074 May 16 08:00 README
  4. Run grip. Now it does not find the README
    $ grip
    Error: No README found at .
  5. Run grip, but this time specify the README file
    $ grip README
  • Serving Flask app 'grip.app'
  • Debug mode: off
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on http://localhost:6419
    Press CTRL+C to quit

Actual result:
At step 4: grip does not find README

Expected result:
At step 4: grip should have found README, or the error message should clarify what file grip is trying to open.

Strace reveals grip is trying to find README.md and README.markdown, but it does not try to find README, so it can't find it. Therefore the error message is confusing:
$ strace grip 2>&1 | grep "(No such file or directory)"
newfstatat(AT_FDCWD, "./README.md", 0x7ffd5b241f90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "./README.markdown", 0x7ffd5b241f90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "./Readme.md", 0x7ffd5b241f90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "./Readme.markdown", 0x7ffd5b241f90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "./readme.md", 0x7ffd5b241f90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "./readme.markdown", 0x7ffd5b241f90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "./Home.md", 0x7ffd5b241f90, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "./Home.markdown", 0x7ffd5b241f90, 0) = -1 ENOENT (No such file or directory)

my versions:
$ grip --version
Grip 4.6.1
$ uname -a
Linux cedric 6.3.1-arch2-1 #1 SMP PREEMPT_DYNAMIC Wed, 10 May 2023 08:54:47 +0000 x86_64 GNU/Linux