Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#323 closed defect (fixed)

Registering user gives OSError

Reported by: pickscrape Owned by: mgood
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 9 years ago by athomas

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 9 years ago by pickscrape

  • Resolution set to fixed
  • Status changed from new to closed

Confirmed. Thanks for the speedy fix. :)

comment:3 Changed 9 years ago by mgood

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:4 Changed 9 years ago by mgood

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:5 Changed 9 years ago by pickscrape

My apologies, I'll remember for next time.

Add Comment

Modify Ticket

Action
as closed The owner will remain mgood.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.