Comments (11)
Aha! It looks like I accidentally installed the old bplist into the same environment:
$ pip freeze | grep bpylist
bpylist==0.1.4
bpylist2==3.0.0
from dogsheep-photos.
Yes, I just recreated my virtual environment from scratch and the error went away.
The problem occurred when I ran pip install datasette-bplist
in the same virtual environment - https://github.com/simonw/datasette-bplist/blob/master/setup.py depends on bpylist
which is incompatible with bpylist2
.
from dogsheep-photos.
More from the debugger:
> /Users/simon/.local/share/virtualenvs/photos-to-sqlite-0uGSHd6e/lib/python3.8/site-packages/osxphotos/photoinfo.py(614)place()
-> self._place = PlaceInfo5(self._info["reverse_geolocation"])
And:
> /Users/simon/Dropbox/Development/photos-to-sqlite/photos_to_sqlite/utils.py(91)osxphoto_to_row()
-> place = photo.place
from dogsheep-photos.
So it appears it's possible for photo.place
to raise that exception. A workaround could be to catch that and treat those photos as not having a place.
from dogsheep-photos.
Ugh....Yeah, I think easiest is to catch the exception and return no place as you suggest. This particular bit of code involves un-archiving a serialized NSKeyedArchiver which uses an object table and it is certainly possible to create a circular reference that way. Because this is happening in the decode, the circular reference must be in the original data. Does Photos show valid reverse geolocation info for the photo in question? If so, Photos may be doing something beyond a simple decode of the binary plist. For now, I'll push a patch to catch the exception.
from dogsheep-photos.
Marketcircle/bpylist#2 looks relevant here.
from dogsheep-photos.
@RhetTbull I tried that workaround and it turns out I'm getting this error on ALL of my photos now!
It's weird: a few day ago this wasn't happening. Now it's happening to everything. I'm not sure what I might have changed.
from dogsheep-photos.
@simonw does Photos show valid reverse geolocation info? Are you sure you're using bpylist2 and not bpylist? They're both unfortunately imported as "bpylist" so if you somehow got the wrong (original bpylist) version installed, it could be the issue.
from dogsheep-photos.
Did removing old bpylist solve the original problem or do you still have a photo that throws circular reference?
from dogsheep-photos.
Frustrates me when package authors create a "drop in" replacement with the same import name...this kind of thing has bitten me more than once! Would've been nicer I think for bpylist2 to do "import bpylist2 as bpylist"
from dogsheep-photos.
I have also run into this a bit, would it be possible to post your requirements.txt
so I can try and reproduce your blog post?
from dogsheep-photos.
Related Issues (20)
- Annotate photos using the Google Cloud Vision API HOT 5
- Expose scores from ZCOMPUTEDASSETATTRIBUTES HOT 7
- Import machine-learning detected labels (dog, llama etc) from Apple Photos HOT 13
- Only install osxphotos if running on macOS HOT 3
- Switch CI solution to GitHub Actions with a macOS runner HOT 1
- apple-photos command should work even if upload has not run HOT 1
- Ability to serve thumbnailed Apple Photo from its place on disk HOT 10
- Try out ExifReader HOT 4
- create-subset command for creating a publishable subset of a photos database HOT 1
- Configurable URL for images HOT 1
- Create a public demo HOT 5
- Rename project to dogsheep-photos HOT 8
- photos_with_apple_metadata view should include labels
- Invalid SQL no such table: main.uploads HOT 1
- KeyError: 'Contents' on running upload HOT 3
- photo-to-sqlite: command not found HOT 4
- bucket name
- Support to annotate photos on other than macOS OSes HOT 1
- ImportError: cannot import name 'formatargspec' from 'inspect'
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 dogsheep-photos.