Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not installing on Python 3.3. #25

Closed
wants to merge 5 commits into from
Closed

Conversation

velis74
Copy link
Contributor

@velis74 velis74 commented Oct 27, 2013

Seems imports are at fault, the path for makernote* is not automatically found when module is being installed. I modified the imports so that they work. Tested to be working on Python 2.7 and 3.3.

Fix import not working in Python 3.3
Fix import not working in Python 3.3
str / bytes coexistence support
@velis74
Copy link
Contributor Author

velis74 commented Oct 28, 2013

Sorry about yesterday, don't know why I thought those minor modifications would ever work. Should have known there'd be more since package listed only Python 2.x support.
Anyway, this pull request (I hope it works, there are 5 files modified) contains a properly working Python 3.x code. This should also work on 2.6 and 2.7, but NOT on 2.5. 2.5 doesn't support bytes and that would require a much more complicated approach to make it compatible.
This has NOT been throughly tested: I only have Canon camera JPEGs and I saw 3 more different formats were supported (which I didn't test). Hopefully you will find it useful regardless.

@leprechaun
Copy link
Contributor

Can I assume you're also seeing an error like this:

Downloading/unpacking exifread
  Running setup.py egg_info for package exifread
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/pip-build-root/exifread/setup.py", line 5, in <module>
        from exifread import __version__
      File "./exifread/__init__.py", line 2, in <module>
        from .classes import *
      File "./exifread/classes.py", line 7, in <module>
        from .tags import *
      File "./exifread/tags/__init__.py", line 3, in <module>
        import makernote
    ImportError: No module named 'makernote'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>
  File "/tmp/pip-build-root/exifread/setup.py", line 5, in <module>
    from exifread import __version__
  File "./exifread/__init__.py", line 2, in <module>
    from .classes import *
  File "./exifread/classes.py", line 7, in <module>
    from .tags import *
  File "./exifread/tags/__init__.py", line 3, in <module>
    import makernote
ImportError: No module named 'makernote'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/exifread

@velis74
Copy link
Contributor Author

velis74 commented Nov 6, 2013

Yes, these were the kind of errors that were fixed using simple "from .
import xxx".
That was but the beginning of it though. The biggest issue was converting
bytes <--> string for all those comparisons in the code.

But ultimately the changes are not THAT drastic. Code is mostly untouched
aside from some constant typing.

LP,
Jure

On Wed, Nov 6, 2013 at 12:14 PM, leprechaun notifications@github.comwrote:

Can I assume you're also seeing an error like this:

Downloading/unpacking exifread
Running setup.py egg_info for package exifread
Traceback (most recent call last):
File "", line 16, in
File "/tmp/pip-build-root/exifread/setup.py", line 5, in
from exifread import version
File "./exifread/init.py", line 2, in
from .classes import *
File "./exifread/classes.py", line 7, in
from .tags import *
File "./exifread/tags/init.py", line 3, in
import makernote
ImportError: No module named 'makernote'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "", line 16, in
File "/tmp/pip-build-root/exifread/setup.py", line 5, in
from exifread import version
File "./exifread/init.py", line 2, in
from .classes import *
File "./exifread/classes.py", line 7, in
from .tags import *
File "./exifread/tags/init.py", line 3, in
import makernote
ImportError: No module named 'makernote'

Command python setup.py egg_info failed with error code 1 in
/tmp/pip-build-root/exifread


Reply to this email directly or view it on GitHubhttps://github.com//pull/25#issuecomment-27864244
.

@ianare
Copy link
Owner

ianare commented Nov 14, 2013

I've cherry picked the first 2 commits into the dev branch since they are 2.5 compatible.

I'm not sure I want to drop 2.5 support just yet, though getting proper 3.x support is by far the most important evolution.

@velis74
Copy link
Contributor Author

velis74 commented Nov 14, 2013

first 2 commits?
I've made 2 pull requests, but I don't think the full shebang is 2.5
compatible. It could be made so, 2.5 can be forced to work with bytes
through a special function, but that function would have made the code a
bit less pretty for the newer versions. Except if all the constants are
moved into a separate file and then just used in code as constants...

The second pull request (and its 5 files) offer pretty much full Python
3.3. operation. I'm happily using that now to parse EXIF in my photo
collection a few 10000s of images.

Thanks for this awesome library.

LP,
Jure

On Thu, Nov 14, 2013 at 5:25 PM, ianaré sévi notifications@github.comwrote:

I've cherry picked the first 2 commits into the dev branch since they are
2.5 compatible.

I'm not sure I want to drop 2.5 support just yet, though getting proper
3.x support is by far the most important evolution.


Reply to this email directly or view it on GitHubhttps://github.com//pull/25#issuecomment-28497993
.

@ianare
Copy link
Owner

ianare commented Nov 14, 2013

Yes, I've merged commits 3789ba4 & ffb87a9 of this pull request (dealing with import problems).

I'd like to have one last (very) stable release of 2.5 compatible code before merging 3.3 compatible code, however it seems reasonable to start a 3.x branch based on your work for further development and testing.

@velis74
Copy link
Contributor Author

velis74 commented Nov 15, 2013

Thanks, I also think this lib deserves proper 3.x support.
And - as I read the documentation - this is all possible to do with keeping
2.5 compatibility, but I opted out of that route because it made the code
look messy.

LP,
Jure

On Thu, Nov 14, 2013 at 10:33 PM, ianaré sévi notifications@github.comwrote:

Yes, I've merged commits 3789ba43789ba4&
ffb87a9 ffb87a9 of this pull
request (dealing with import problems).

I'd like to have one last (very) stable release of 2.5 compatible code
before merging 3.3 compatible code, however it seems reasonable to start a
3.x branch based on your work for further development and testing.


Reply to this email directly or view it on GitHubhttps://github.com//pull/25#issuecomment-28524939
.

@jean-petitclerc
Copy link

The 3.3 implementation works for me. I needed it so it is much appreciated. Thanks Velis74.

Also a big "thank you" to Ianare. Nice work. Elegant code.

Jean Petitclerc

PS: EXIF.py issues this error but it is a minor issue for me:
Opening: /home/jean/Downloads/IMG_8032.JPG
File has JPEG thumbnail
Traceback (most recent call last):
File "bin/EXIF.py", line 132, in
main()
File "bin/EXIF.py", line 116, in main
tag_keys.sort()
AttributeError: 'dict_keys' object has no attribute 'sort'

@leprechaun
Copy link
Contributor

@jean-petitclerc, actually, that's already been fixed, it's in develop.
@ianare, would thiis not be worth cherry-picking? It's a quick win.

@velis74
Copy link
Contributor Author

velis74 commented Dec 28, 2013

If I can be of further assistance, let me know.
Jure
On 28 Dec 2013 11:11, "leprechaun" notifications@github.com wrote:

@jean-petitclerc https://github.com/jean-petitclerc, actually, that's
already been fixed, it's in develop.
@ianare https://github.com/ianare, would thiis not be worth
cherry-picking? It's a quick win.


Reply to this email directly or view it on GitHubhttps://github.com//pull/25#issuecomment-31293837
.

@ianare
Copy link
Owner

ianare commented Dec 28, 2013

It's been a while since the last release and no major bugs have been reported, so I think it's time to move forward.

I've merged this pull request into the develop branch. This means the next release will be python3 compatible, and support for 2.5 will be dropped.

If you would like to help, you can try running against the test images in https://github.com/ianare/exif-samples. You can also contribute images to this repo if you have images of your own that fail.

I will try to put in place some travis tests in the near future.

A big thanks to velis74 for this contribution!

  • ianaré

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants