Modify

Opened 15 years ago

Closed 15 years ago

#6356 closed defect (wontfix)

Rename of SvnPasswordStore raises WindowsError in Trac 0.11.6

Reported by: trac-hacks@… Owned by: John Hampton
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I'm running Trac 0.11.6 on Windows XP Pro using TracAccountManager Plugin. If the user tries to register, the "rename" function runs into the first exception and throws an error.

2009-12-20 19:43:05,696 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File "C:\Server\Python26\lib\site-packages\trac-0.11.6-py2.6-win32.egg\trac\web\main.py", line 450, in _dispatch_request
    dispatcher.dispatch(req)
  File "C:\Server\Python26\lib\site-packages\trac-0.11.6-py2.6-win32.egg\trac\web\main.py", line 206, in dispatch
    resp = chosen_handler.process_request(req)
  File "C:\Server\Python26\lib\site-packages\tracaccountmanager-0.2.1dev_r0-py2.6.egg\acct_mgr\web_ui.py", line 400, in process_request
    _create_user(req, self.env)
  File "C:\Server\Python26\lib\site-packages\tracaccountmanager-0.2.1dev_r0-py2.6.egg\acct_mgr\web_ui.py", line 70, in _create_user
    mgr.set_password(user, password)
  File "build\bdist.win32\egg\acct_mgr\api.py", line 128, in set_password
    if store.set_password(user, password):
  File "build\bdist.win32\egg\acct_mgr\svnserve.py", line 60, in set_password
    cfg.save()
  File "C:\Server\Python26\lib\site-packages\trac-0.11.6-py2.6-win32.egg\trac\config.py", line 225, in save
    fileobj.close()
  File "C:\Server\Python26\lib\site-packages\trac-0.11.6-py2.6-win32.egg\trac\util\__init__.py", line 178, in commit
    rename(self._temp, self._path)
  File "C:\Server\Python26\lib\site-packages\trac-0.11.6-py2.6-win32.egg\trac\util\__init__.py", line 120, in rename
    raise ctypes.WinError()

Replacing "FileMoveEx" (line 120: init.py in trac\utils) with

os.remove(dst)
os.rename(src, dst)

fixed the error. (but i'm not that much into python to say that it doesn't break anything else)

I'm pretty sure this is a general trac bug, but - the trac ticket guidelines sent me here ... ;)

Attachments (0)

Change History (4)

comment:1 Changed 15 years ago by Mikael Relbe

I can confirm this error, but shouldn't this be addressed to Trac instead?

See trac:ticket:8623#comment:16 which states:

On Windows XP and lower, or without ctypes, the rename will not be atomic and may fail, due to concurrent updates or if the config file is open for reading. In the former case, the worst that can happen is that a temporary file could be left in the conf directory. In the latter case, the update will simply fail, and the user will be alerted. Both cases should be rare enough.

Could we have the same problem (I've seen this on numerous WinXP Pro machines...)

comment:2 in reply to:  1 Changed 15 years ago by trac-hacks@…

Replying to mrelbe:

I can confirm this error, but shouldn't this be addressed to Trac instead?

Could we have the same problem (I've seen this on numerous WinXP Pro machines...)

Yup, seems to be the same one. The atomic file modifications are only available on systems with "Transactional NTFS" (TxF) so Windows Vista and above. I think the code in init.py should be changed to recognize the file-system type to do something the OS understands...

I already tried to reach someone on IRC, and there was one who want to have a look on it. I don't know if I should open a trac ticket. The guidelines sounds so restrictive to me...

Thank you for the confirmation :D

comment:3 Changed 15 years ago by Mikael Relbe

I re-opened that ticket myself, on "the other side". Perhaps I will not be welcome there again :)

comment:4 Changed 15 years ago by Remy Blank

Resolution: wontfix
Status: newclosed

This was due to AccountManagerPlugin using Unicode paths, which were (accidentally) not supported. It's fixed now in [T8994], and will be released in 0.11.7. There's nothing more to do here, so I'm closing this ticket

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain John Hampton.
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.