Git Product home page Git Product logo

Comments (3)

micahellison avatar micahellison commented on September 23, 2024

Looks like this is Windows-only, since a related CI test is failing only on Windows.

I also couldn't replicate this locally on WSL/Ubuntu. jrnl --diagnostic output:

jrnl: v4.1
Python: 3.11.6 (main, Oct  2 2023, 13:45:54) [GCC 11.4.0]
OS: Linux 5.15.146.1-microsoft-standard-WSL2

from jrnl.

micahellison avatar micahellison commented on September 23, 2024

I'm mystified by this bug. os.makedirs is supposed to create all directories in the path that don't exist, so why is Windows kicking out an error about it not existing? Furthermore, we have a passing BDD test in file_storage.feature for exactly this problem.

I was able to reproduce this locally for a little while. I also reproduced it in the interactive Python 3.12 shell with os.makedirs. Then I did something--I'm not sure what--and now it just works. What changed? Maybe a permissions issue on one of those temp subfolders? But why would that have existed in the first place? And why does this appear in GitHub Actions, but only for a new PR?

I searched around for others with issue, but most of the resolutions I see also don't seem to make much sense, and I think they're not actually solving the problem so much as drawing post hoc conclusions. I don't see anyone writing code to fix this problem.

Whatever the case, that brief test that reproduced this problem in interactive Python showed that it's a problem with Windows (or Python on Windows), rather than a problem with jrnl. Python on Windows is failing to deliver what the os.makedirs documentation promises, or, at the least, it's failing to accurately report the reason it can't meet that promise, so I'm closing this as wont-fix.

If you're a jrnl user and you have this problem, please let us know here and maybe we can narrow it down some more, but without reports of anyone else running into this, I don't think it's worth the effort to keep investigating.

from jrnl.

comkieffer avatar comkieffer commented on September 23, 2024

I've found the root cause for this and it's expected behaviour (though unintuitive behaviour).

From the docs, Jrnl detects that a journal is a Folder journal if

  • a folder with the name of the journal before running jrnl.
  • the journal path in the config ends with the path separator

In the empty_folder config, the journal path is specified without a path separator at the end. To fix the test failures we could add the path separator to the path in the config but then two configs would be needed (one for Posix, one for

A proper fix would be to use pathlib instead of os.path since that translates Posix paths into windows paths when required.

The fact that the tests work on Linux is the actual bug. Running

jrnl --cf tests/data/configs/empty_folder.yaml --debug "this is my jrnl entry"

shows that, on Linux, it creates a FileJournal and happily chugs along.

from jrnl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.