Missing __init__.py file on package

Bug #1513961 reported by Thiago Bellini
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-qrcode (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

The package is missing a __init__.py file on the qrcode/image package, making it useless. Just try to 'import qrcode' and since qrcode.image is not a package because of the missing file, and the qrcode/__init__.py tries to import it, it will not work.

Just by changing the rules to do 'dh $@ --with python2' (which is the rule being used by newer versions of this package on vivid/whily/etc) instead of 'dh $@' made it correct. The change is attached on the bug.

I uploaded a new version with the change on my ppa here <https://launchpad.net/~hackedbellini/+archive/ubuntu/misc> so you can test it if you want.

Tags: patch
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "qrcode.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Thiago Bellini (bellini666) wrote :
Mathew Hodson (mhodson)
Changed in python-qrcode (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

Package works fine in wily, xenial, and sid.

Changed in python-qrcode (Ubuntu):
status: New → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

I can't reproduce that error in trusty either. It imports fine, and it has a /usr/share/pyshared/qrcode/__init__.py .

As this report doesn't specify a release (maybe this was utopic or so?), leaving closed.

Revision history for this message
Thiago Bellini (bellini666) wrote :

@pitty the error is on trusty only.

Yes, the /usr/share/pyshared/qrcode/__init__.py exists, what is missing in it is the /usr/share/pyshared/qrcode/image/__init__.py, as you can see here http://packages.ubuntu.com/trusty/all/python-qrcode/filelist

Try importing qrcode.main for example (as it will try to import qrcode.image.base.BaseImage) and it will give you an ImportError

Revision history for this message
Thiago Bellini (bellini666) wrote :

@pitti: Ok, that is weird. Just tested on a trusty vm and I could not reproduce the problem.

When I reproduced it, I extracted qrcode from the deb, put the directory on PYTHONPATH and ran it.

I did that because, even though I was running trusty, I don't have sudo powers to install the package myself (this is a diskless station at my work, I use debian at home and thus could not reproduce there either), and I was trying to check if the python-qrcode package on trusty was compatible with something I'm developing.

When I did that, it gave me an ImportError (as is expected because of the missing qrcode/image/__init__.py that should make it not be considered a package) that I could fix by creating the missing file. Then I came here to report the "bug".

The question now is, why those 2 approaches are giving me different results? AFAIK, they should run equally.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.