ImportError: No module named locked_file

Bug #1594437 reported by Felipe Reyes
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-googleapi (Ubuntu)
Fix Released
Medium
Felipe Reyes
Xenial
Fix Released
Medium
Felipe Reyes

Bug Description

[Impact]

When using google's python client, it's not possible to benefit from caching capabilities provided by oauth2client due to a wrong import.

This was fixed in 1.5.1, which is the version available in yakkety.

[Test Case]

* Install gcalcli (apt-get install gcalcli)
* Run gcalcli and log in to your account
* Run "gcalcli agenda"

Expected Result:

The calendar's agenda view is printed

Actual Result:

A ImportError is printed and then agenda

WARNING:root:No module named locked_file
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/googleapiclient/discovery_cache/__init__.py", line 38, in autodetect
    from . import file_cache
  File "/usr/lib/python2.7/dist-packages/googleapiclient/discovery_cache/file_cache.py", line 32, in <module>
    from oauth2client.locked_file import LockedFile
ImportError: No module named locked_file

[Regression Potential]

* Low, eventually stale caching files may give problems, but this will be unveiling issues in the cache management.
* I've been testing the proposed fix locally and it works OK for my use cases.

[Other Info]

* Upstream fix: https://github.com/google/google-api-python-client/commit/bb324623

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: python-googleapi 1.4.2-1ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Mon Jun 20 11:51:22 2016
InstallationDate: Installed on 2015-10-19 (244 days ago)
InstallationMedia: Ubuntu-GNOME 15.04 "Vivid Vervet" - Release amd64 (20150422)
PackageArchitecture: all
SourcePackage: python-googleapi
UpgradeStatus: Upgraded to xenial on 2016-04-08 (72 days ago)

Revision history for this message
Felipe Reyes (freyes) wrote :
Revision history for this message
Felipe Reyes (freyes) wrote :

Here I'm attaching a patch to fix Xenial, I've been testing it locally and it works OK for my use cases.

Changed in python-googleapi (Ubuntu):
assignee: nobody → Felipe Reyes (freyes)
Felipe Reyes (freyes)
description: updated
Mathew Hodson (mhodson)
Changed in python-googleapi (Ubuntu):
importance: Undecided → Medium
Jeremy Bícha (jbicha)
Changed in python-googleapi (Ubuntu Xenial):
importance: Undecided → Medium
status: New → Triaged
Changed in python-googleapi (Ubuntu):
status: New → Fix Released
Revision history for this message
Robie Basak (racb) wrote :

Uploaded, thanks. Now awaiting SRU team review.

Note that I ran "update-maintainer" before uploading, as evidently this was missed in the original upload of 1.4.2-1ubuntu1.

Changed in python-googleapi (Ubuntu Xenial):
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Felipe, or anyone else affected,

Accepted python-googleapi into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-googleapi/1.4.2-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python-googleapi (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Felipe Reyes (freyes) wrote :

The package available in xenial-proposed fixes the issue.

Evidence:

$ gcalcli agenda
WARNING:root:No module named locked_file
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/googleapiclient/discovery_cache/__init__.py", line 38, in autodetect
    from . import file_cache
  File "/usr/lib/python2.7/dist-packages/googleapiclient/discovery_cache/file_cache.py", line 32, in <module>
    from oauth2client.locked_file import LockedFile
ImportError: No module named locked_file

Sun Jun 26 [...]
$ sudo apt-get install python-googleapi
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gir1.2-lokdocview-0.1 libjpeg62 libreoffice-gtk3 libvala-0.28-0 linux-tools-4.4.0-22
  linux-tools-4.4.0-22-generic python-charmworldlib squashfs-tools ubuntu-core-launcher
  valac-0.28-vapi
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  python-googleapi
1 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
Need to get 0 B/36.7 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
(Reading database ... 340557 files and directories currently installed.)
Preparing to unpack .../python-googleapi_1.4.2-1ubuntu1.1_all.deb ...
Unpacking python-googleapi (1.4.2-1ubuntu1.1) over (1.4.2-1ubuntu1) ...
Setting up python-googleapi (1.4.2-1ubuntu1.1) ...
$ gcalcli agenda

Sun Jun 26 [...]

tags: added: verification-done
removed: verification-needed
Changed in python-googleapi (Ubuntu Xenial):
assignee: nobody → Felipe Reyes (freyes)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-googleapi - 1.4.2-1ubuntu1.1

---------------
python-googleapi (1.4.2-1ubuntu1.1) xenial; urgency=medium

  * d/p/0001-Allow-using-oauth2client-versions-2.patch: Fix oauth2client cache
    module import (LP: #1594437).

 -- Felipe Reyes <email address hidden> Mon, 20 Jun 2016 12:06:43 -0400

Changed in python-googleapi (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for python-googleapi has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.