strip any trailing slash from hook Pattern entry
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
click (Ubuntu) |
Fix Released
|
Low
|
Colin Watson |
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@
Traceback (most recent call last):
File "/usr/bin/click", line 83, in <module>
sys.
File "/usr/bin/click", line 79, in main
return mod.run(args)
File "/usr/lib/
registry.
File "/usr/lib/
self.db, package, old_version, version, user=self.user)
File "/usr/lib/
package, new_version, app_name, relative_path, user=user)
File "/usr/lib/
user=user, user_db=user_db)
File "/usr/lib/
osextras.
File "/usr/lib/
unlink_
File "/usr/lib/
os.unlink(path)
IsADirectoryError: [Errno 21] Is a directory: '/home/
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: click 0.4.11
ProcVersionSign
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)
Related branches
- Colin Watson: Approve
- Ubuntu CI managed package branches: Pending requested
-
Diff: 485 lines (+269/-70)11 files modifiedREADME (+1/-0)
click/build.py (+10/-22)
click/framework.py (+138/-0)
click/install.py (+8/-28)
click/paths.py.in (+1/-0)
click/tests/helpers.py (+29/-0)
click/tests/test_build.py (+39/-5)
click/tests/test_install.py (+2/-4)
debian/changelog (+8/-0)
doc/file-format.rst (+1/-2)
doc/index.rst (+32/-9)
summary: |
- Click hooks should be able to apply to directories recursively + unlink_force fails on directories, making it impossible to pass dirs to + click hooks |
Changed in click (Ubuntu): | |
assignee: | nobody → Colin Watson (cjwatson) |
status: | Triaged → Fix Committed |
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?