Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#323 closed defect (fixed)

Registering user gives OSError

Reported by: Russ Brown Owned by: Matt Good
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.9

Description

I recently upgraded both trac and the AccountManager plugin and now registering a new user fails with the following:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 299, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 189, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/acct_mgr/web_ui.py", line 117, in process_request
  File "build/bdist.linux-i686/egg/acct_mgr/web_ui.py", line 138, in _do_create
  File "build/bdist.linux-i686/egg/acct_mgr/api.py", line 88, in set_password
  File "build/bdist.linux-i686/egg/acct_mgr/htfile.py", line 50, in set_password
  File "build/bdist.linux-i686/egg/acct_mgr/htfile.py", line 77, in _update_file
  File "/usr/lib/python2.4/fileinput.py", line 231, in next
    line = self.readline()
  File "/usr/lib/python2.4/fileinput.py", line 300, in readline
    os.rename(self._filename, self._backupfilename)
OSError: [Errno 16] Device or resource busy

I think it was the update to trac itself that triggered the problem as I tried updating the plugin to fix the problem, to no avail.

The password file is writeable by trac, as is the directory it is contained within.

Attachments (0)

Change History (5)

comment:1 Changed 11 years ago by Alec Thomas

This is a Unicode problem. Following patch fixes it.

  • trunk/acct_mgr/htfile.py

     
    7474        filename = self._get_filename()
    7575        written = False
    7676        if os.path.exists(filename):
    77             for line in fileinput.input(filename, inplace=True):
     77            for line in fileinput.input(str(filename), inplace=True):
    7878                if line.startswith(prefix):
    7979                    if not written and userline:
    8080                        print userline
  • 0.9/acct_mgr/htfile.py

     
    7474        filename = self._get_filename()
    7575        written = False
    7676        if os.path.exists(filename):
    77             for line in fileinput.input(filename, inplace=True):
     77            for line in fileinput.input(str(filename), inplace=True):
    7878                if line.startswith(prefix):
    7979                    if not written and userline:
    8080                        print userline

comment:2 Changed 11 years ago by Russ Brown

Resolution: fixed
Status: newclosed

Confirmed. Thanks for the speedy fix. :)

comment:3 Changed 11 years ago by Matt Good

Resolution: fixed
Status: closedreopened

Well, you shouldn't close the ticket until the fix has been committed.

comment:4 Changed 11 years ago by Matt Good

Resolution: fixed
Status: reopenedclosed

(In [705]) apparently fileinput has a bug handling unicode filenames, so convert it to a string (fixes #323)

comment:5 Changed 11 years ago by Russ Brown

My apologies, I'll remember for next time.

Modify Ticket

Action
as closed The owner will remain Matt Good.
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.