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

Bug #341916 reported by Cristian Salamea on 2009-03-12
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trac-Bzr
Undecided
Unassigned

Bug Description

==== How to Reproduce ====

While doing a GET operation on `/browser`, Trac issued an internal error.

''(please provide additional details here)''

Request parameters:
{{{
{'path': '/'}
}}}

User Agent was: `Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6`

==== System Information ====

|| '''Trac''' || `0.11.2.1` ||
|| '''Python''' || `2.5.2 (r252:60911, Mar 1 2008, 13:52:45) ` [[br]] `[GCC 4.2.3]` ||
|| '''setuptools''' || `0.6c9` ||
|| '''SQLite''' || `3.3.17` ||
|| '''pysqlite''' || `2.4.1` ||
|| '''Genshi''' || `0.5.1` ||
|| '''mod_python''' || `3.3.1` ||
|| '''Pygments''' || `1.0` ||
|| '''jQuery:''' || `1.2.6` ||

==== Python Traceback ====
{{{
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 432, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 204, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/versioncontrol/web_ui/browser.py", line 342, in process_request
    node = get_existing_node(req, repos, path, rev_or_latest)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/versioncontrol/web_ui/util.py", line 58, in get_existing_node
    return repos.get_node(path, rev)
  File "build/bdist.linux-i686/egg/tracbzr/backend.py", line 349, in get_node
    revbranch, revid = self._parse_rev(rev)
  File "build/bdist.linux-i686/egg/tracbzr/backend.py", line 213, in _parse_rev
    if rev.isdigit():
AttributeError: 'int' object has no attribute 'isdigit'

}}}

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

line 217

if rev.isdigit() , that is the error rev is int value and not has that atribute, i changed to

if type(rev)==int: solve the problem

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

attached the patch

Revision history for this message
bjw (bjw) wrote :

The same situation on windows:
==== How to Reproduce ====

While doing a GET operation on `/browser`, Trac issued an internal error.

''(please provide additional details here)''

Request parameters:
{{{
{'path': '/'}
}}}

User Agent was: `Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7`

==== System Information ====

|| '''Trac''' || `0.11.2.1` ||
|| '''Python''' || `2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)]` ||
|| '''setuptools''' || `0.6c9` ||
|| '''SQLite''' || `3.3.4` ||
|| '''pysqlite''' || `2.3.2` ||
|| '''Genshi''' || `0.5.1` ||
|| '''jQuery:''' || `1.2.6` ||

==== Python Traceback ====
{{{
Traceback (most recent call last):
  File "c:\python25\lib\site-packages\Trac-0.11.2.1-py2.5-win32.egg\trac\web\main.py", line 432, in _dispatch_request
    dispatcher.dispatch(req)
  File "c:\python25\lib\site-packages\Trac-0.11.2.1-py2.5-win32.egg\trac\web\main.py", line 204, in dispatch
    resp = chosen_handler.process_request(req)
  File "c:\python25\lib\site-packages\Trac-0.11.2.1-py2.5-win32.egg\trac\versioncontrol\web_ui\browser.py", line 342, in process_request
    node = get_existing_node(req, repos, path, rev_or_latest)
  File "c:\python25\lib\site-packages\Trac-0.11.2.1-py2.5-win32.egg\trac\versioncontrol\web_ui\util.py", line 58, in get_existing_node
    return repos.get_node(path, rev)
  File "build\bdist.win32\egg\tracbzr\backend.py", line 349, in get_node
    revbranch, revid = self._parse_rev(rev)
  File "build\bdist.win32\egg\tracbzr\backend.py", line 213, in _parse_rev
    if rev.isdigit():
AttributeError: 'int' object has no attribute 'isdigit'

}}}

Revision history for this message
bjw (bjw) wrote :

Ok, now after patch it works. Thanks!

Maybe this could be merged into trunk?

Have a nice day/night!
bjw

Revision history for this message
Cristian Salamea (ovnicraft) wrote : Re: [Bug 341916] Re: AttributeError: 'int' object has no attribute 'isdigit'

2009/3/17 bjw <email address hidden>

> Ok, now after patch it works. Thanks!
>
> Maybe this could be merged into trunk?
>
> Have a nice day/night!
> bjw
>

I dont know that, poject owners must aprove the patch, can you tell me if
you see the timeline code?

regards,

> --
> AttributeError: 'int' object has no attribute 'isdigit'
> https://bugs.launchpad.net/bugs/341916
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Cristian Salamea
CEO GnuThink Software Labs
Software Libre / Open Source
(+593-8) 4-36-44-48

Revision history for this message
INADA Naoki (songofacandy) wrote :

=== modified file 'tracbzr/backend.py'
--- tracbzr/backend.py 2009-01-19 16:42:31 +0000
+++ tracbzr/backend.py 2009-03-20 09:52:09 +0000
@@ -164,7 +164,7 @@
             return self._escape(revid, ':')
         relpath = self.branch_path(branch)
         try:
- return self._string_rev_revno(relpath, branch.revision_id_to_revno(revid))
+ return self._string_rev_revno(relpath, str(branch.revision_id_to_revno(revid)))
         except errors.NoSuchRevision:
             dotted = self.dotted_revno(branch, revid)
             if dotted is not None:
@@ -385,6 +385,8 @@
         else:
             return self.string_rev(None, 'current:')

+ youngest_rev = property(get_youngest_rev)
+
     def _repo_history(self):
         revisions = {}
         repos = {}

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

i doesnt solve my problem with repo checkins

Repository checkins event provider (ChangesetModule) failed:
NoSuchChangeset: No changeset null: in the repository

any suggest? i am working in that.

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Repository checkins appears but when try to read one says Error: No such changeset

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

So, i recommend you use https://edge.launchpad.net/bzr-trac, that project rewrite this and make it better :)

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Cristian, I don't see why a hostile fork would be needed to have a simple bug fixed.

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

I fixed one bug , but i have many bugs also with timeline and roadmap trying to see changes, i explained in my comment, over one month that bug was not fixed in trunk and i found another plugin that works ok.
Check the percent bugs in solved bugs, accepted in fixed or merged in trunk, maybe the manteiners not follows this project :(, so what can do bzr+trac users?

Revision history for this message
Tim Black (tim-alwaysreformed) wrote :

A previous revision contains these differences:

221c213
< if rev.isdigit():
---
> if str(rev).isdigit():
236c228
< if rev_rev.isdigit():
---
> if str(rev_rev).isdigit():
244c236
< if not segment.isdigit():
---
> if not str(segment).isdigit():

Those differences fixed this problem for me.

Revision history for this message
Alfred Morgan (zectbumo) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers