Modify

Opened 5 years ago

Closed 4 months ago

#9625 closed defect (fixed)

AttributeError: 'int' object has no attribute 'rsplit'

Reported by: anonymous Owned by: Colin Guthrie
Priority: normal Component: WorkLogPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

Hello,

I have installed WorkLog plugin latest version available on link WorkLogPlugin. I have done necessary settings as per instructions from your link but I am getting below error when I am trying to click on Start/Stop button first time. After getting error if I go back and click again on Start/ Stop then its working fine.

Trac detected an internal error: 
AttributeError: 'int' object has no attribute 'rsplit'
This is probably a local installation issue. 

Some more details.

Trac	0.13dev-r10774
Genshi	0.7dev-r1168
Mercurial	1.9
MySQL	server: "5.1.49-3", client: "5.1.49", thread-safe: 1
MySQLdb	1.2.3
Python	2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5]
setuptools	0.6c11
jQuery	1.5.1

Regards,

Rahul

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by k.antczak@…

Since:

http://svn.edgewall.org/repos/trac/trunk/trac/ticket/model.py

    def save_changes(self, author=None, comment=None, when=None, db=None,
                     cnum='', replyto=None):
        """
        Store ticket changes in the database. The ticket must already exist in
        the database.  Returns False if there were no changes to save, True
        otherwise.

        :since 0.13: the `db` parameter is no longer needed and will be removed
        in version 0.14
        :since 0.13: the `cnum` parameter is deprecated, and threading should
        be controlled with the `replyto` argument

Something should be changed in worklog/manager.py - currently i've changed:

77: tckt.save_changes(self.authname, msg, nowdt, None, cnum+1)

into

77: tckt.save_changes(self.authname, msg, nowdt, None, '', cnum+1)

and it works - for now

comment:2 Changed 4 years ago by kkujawa@…

I also had this issue and while the above alteration didn't fix the problem, the following change to the same line in worklog/manager.py (although it's line 81 in the latest release)

From:

81: tckt.save_changes(self.authname, msg, nowdt, None, cnum=cnum+1)

To:

81: tckt.save_changes(self.authname, msg, nowdt, None, cnum=str(cnum+1))

This issue occurred for me on both Trac Release 0.12 and Trac Release 1.0.

comment:3 in reply to:  2 Changed 4 years ago by kkujawa@…

Additionally, I think the problem is that the worklog/manager.py line is passing cnum as an int where it should be passing it as a str. The error relates to the following from http://svn.edgewall.org/repos/trac/branches/1.0-stable/trac/ticket/model.py:

364: return int(cnum.rsplit('.', 1)[-1])

Reading back on the code before that, it appears to assume that it has been passed an str, and if not it will generate an str - which may explain why this issue occurs on some occasions but not others. It may also explain why the first fix on here worked as it added code to pass an empty str.

comment:4 Changed 4 years ago by Ryan J Ollos

I will try to get the issue fixed shortly. Have you tried out the latest revision of the plugin (r12090)? I pushed a lot of changes over the past few days.

comment:5 Changed 4 months ago by Ryan J Ollos

Description: modified (diff)
Resolution: fixed
Status: newclosed

Issue appears to be resolved.

Modify Ticket

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