Comments (10)
Switching to pytest solved things! Not sure if it was a change on the way, or just your recommendation of tmp_path
, but it's working now :D
from ankipandas.
from ankipandas.
Yes, locally I also get a permission error.
from ankipandas.
col.notes.add_tag seems to be the culprit. I only focused on one of the tests. Might be that the dataframe manipulation causes somekind of os.cwd to be in the directory which could result in this error.
And tempfile causing permissions errors under windows does also seem to be quite the common report.
https://bugs.python.org/issue35144
from ankipandas.
Btw since you are already using pytest. Any reason to not use the tmp_path provided by pytest?
https://docs.pytest.org/en/stable/tmpdir.html#base-temporary-directory
from ankipandas.
Btw since you are already using pytest. Any reason to not use the tmp_path provided by pytest?
https://docs.pytest.org/en/stable/tmpdir.html#base-temporary-directory
Yeah, back then I was still mostly using the unittest
framework. Would do a lot of things differently. But perhaps it's worth to try out if using the pytest fixtures handles this better.
from ankipandas.
col.notes.add_tag seems to be the culprit.
Ah, I don't think so, because that also happens if you simply read and write the same collection. I think this really is a more fundamental issue about reading and writing files (and perhaps not closing them at some point?)
from ankipandas.
pytest provides tmpdir and tmp_path.
tmp_path is already a pathlib object.
i.e.
def test_tmp(tmp_path):
(tmp_path/ "sub").mkdir()
works and you would save the casting.
from ankipandas.
oh, nice :) Thanks!
from ankipandas.
though I saw some issues with that in py3.5 that still require usage of str
: pytest-dev/pytest#5017
But probably we can/should drop py3.5 support at some point soon anyway
from ankipandas.
Related Issues (20)
- How to get the history of reviews of a card/deck? HOT 3
- Document different tables and their content
- [request] need read only access to locked database HOT 5
- How to get the creation date of a card? HOT 2
- Accessing deck settings HOT 9
- Update doesn't work ? What is the correct way of updating single notes ? HOT 11
- Future warning about `Index.__and__`
- Harden interface by marking arguments as keyword-only
- Missing database indices HOT 5
- Columns in documentation HOT 3
- Thank you and similarity scanner I made with it. HOT 4
- Writing to collection breaks synchronization and editing in Ankidroid HOT 13
- is it possible to read an anki portable base? HOT 1
- Incompatibilities with pandas 2.0 HOT 1
- sub- and superdeck support HOT 6
- Problems when adding a note HOT 2
- "Ankipandas Conversion Issue: Erroneous Update Messages in Anki Database Export"
- API docs don't show up properly
- Support opening apkg files out of the box HOT 23
- Reading all notes from a deck HOT 7
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 ankipandas.