[Bug 1253855] Re: Click hooks should be able to apply to directories recursively

Chris Wayne 1253855 at bugs.launchpad.net
Fri Nov 22 02:08:04 UTC 2013


Looking at the trace, it's because it tries to force unlink, which won't
work on a directory.  Should we check if it's a directory and
shutil.rmtree if so?

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to click in Ubuntu.
https://bugs.launchpad.net/bugs/1253855

Title:
  Click hooks should be able to apply to directories recursively

Status in “click” package in Ubuntu:
  New

Bug description:
  In trying to make click-hooks for account-plugins, I've run into an
  issue where I need to pass an entire directory to the click hooks.
  When I try to apply this (by click registering the newly installed
  package), it fails with the following:

  cwayne at athena:~/Projects/touch_apps$ sudo click register --user cwayne com.ubuntu.developer.cwayne18.ach 0.1
  Traceback (most recent call last):
    File "/usr/bin/click", line 83, in <module>
      sys.exit(main())
    File "/usr/bin/click", line 79, in main
      return mod.run(args)
    File "/usr/lib/python3/dist-packages/click/commands/register.py", line 46, in run
      registry.set_version(package, version)
    File "/usr/lib/python3/dist-packages/click/user.py", line 279, in set_version
      self.db, package, old_version, version, user=self.user)
    File "/usr/lib/python3/dist-packages/click/hooks.py", line 383, in package_install_hooks
      package, new_version, app_name, relative_path, user=user)
    File "/usr/lib/python3/dist-packages/click/hooks.py", line 270, in install_package
      user=user, user_db=user_db)
    File "/usr/lib/python3/dist-packages/click/hooks.py", line 249, in _install_link
      osextras.symlink_force(target, link)
    File "/usr/lib/python3/dist-packages/click/osextras.py", line 76, in symlink_force
      unlink_force(link_name)
    File "/usr/lib/python3/dist-packages/click/osextras.py", line 68, in unlink_force
      os.unlink(path)
  IsADirectoryError: [Errno 21] Is a directory: '/home/cwayne/.local/share/accounts/qml-plugins/com.ubuntu.developer.cwayne18.ach_ach_0.1/'

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: click 0.4.11
  ProcVersionSignature: Ubuntu 3.12.0-3.9-generic 3.12.1
  Uname: Linux 3.12.0-3-generic x86_64
  ApportVersion: 2.12.7-0ubuntu1
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Thu Nov 21 20:35:06 2013
  InstallationDate: Installed on 2013-07-26 (118 days ago)
  InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
  SourcePackage: click
  UpgradeStatus: Upgraded to trusty on 2013-11-21 (0 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/click/+bug/1253855/+subscriptions



More information about the foundations-bugs mailing list