Modify

Opened 7 years ago

Closed 5 years ago

Last modified 5 years ago

#6429 closed defect (wontfix)

Rename to a name "deeper" in dir hierarchy fails with attachments

Reported by: anonymous Owned by: Noah Kantrowitz
Priority: normal Component: WikiRenamePlugin
Severity: normal Keywords: attachment
Cc: Trac Release: 0.11

Description

in the util.py it is doing an:

os.reanmes(from_path, to_path)

however if you are trying to rename:

/SomeName/SubName ==> /SomeName/SubName/ItemName

The OSError 22 happens since it is trying to move a dir to a sub dir which doesn't work. I add a tmp dir step to solve this for me.

from tempfile import mkdtemp ... tmp_path = mkdtemp() debug('Moving from %r to %r', from_path, tmp_path) os.renames(from_path, tmp_path) debug('Moving from %r to %r', tmp_path, to_path) os.renames(tmp_path, to_path)

Attachments (0)

Change History (5)

comment:1 Changed 7 years ago by anonymous

Summary: Rename to a a name "deeper" in heirarchy fails with attachmentsRename to a name "deeper" in heirarchy fails with attachments

comment:2 in reply to:  description Changed 7 years ago by anonymous

Replying to anonymous: Or formatted correctly :)

in the util.py it is doing an:

from tempfile import mkdtemp>
...
tmp_path = mkdtemp()
debug('Moving from %r to %r', from_path, tmp_path)
os.renames(from_path, tmp_path)
debug('Moving from %r to %r', tmp_path, to_path)
os.renames(tmp_path, to_path)

comment:3 Changed 7 years ago by Steffen Hoffmann

Keywords: attachment added
Summary: Rename to a name "deeper" in heirarchy fails with attachmentsRename to a name "deeper" in dir hierarchy fails with attachments

since this looks reasonable, just a quick question to (anonymous):

Did you check a situation the other way round too: i.e. /SomeName/SubName/ItemName ==> /SomeName/SubName

looks as if there would arise the need check, if there is an empty dir left, that should be deleted IMHO for good housekeeping in filesystem, right?

comment:4 Changed 5 years ago by Ryan J Ollos

Resolution: wontfix
Status: newclosed

The plugin is deprecated since there is now support in the Trac core.

comment:5 Changed 5 years ago by Ryan J Ollos

If you'd like to apply patches I can provide you commit access.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.