Comments (3)
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.
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.
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)
- Tests failing on develop branch starting with pytest-bdd 7.1.2 HOT 4
- -contains doesn't accept multiple search terms, doesn't work with -and HOT 2
- Tests are failing with pytest 8.1 HOT 3
- [Bug Report] AttributeError: '_PasswordRetriever' object has no attribute 'encode' HOT 10
- Compatibility with VJOURNAL standard HOT 2
- Remove documentation recommendation to install pipx through brew or pip HOT 1
- No module named 'pygments' after pygments upgrade HOT 1
- Recommend pipx as default installation method
- Feature Report : Custom save location HOT 2
- Add Python 3.13 support HOT 2
- jrnl-org/nostr? HOT 1
- Inject current date at start of a new entry being composed in an editor HOT 1
- Support Request HOT 1
- User is always asked to update when config resembles JSON HOT 1
- Writing a journal entry with tomorrow's date HOT 2
- Bug Report HOT 1
- Error: 'str' object cannot be interpreted as an integer HOT 1
- Have more examples of supported humanized datetime formats
- Support bracketed date style when composing new entry
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jrnl.