You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by Apache Bloodhound <de...@bloodhound.apache.org> on 2014/02/04 21:08:18 UTC

[Apache Bloodhound] #751: UnboundLocalError: local variable 'rsys' referenced before assignment

#751: UnboundLocalError: local variable 'rsys' referenced before assignment
---------------------+--------------------
  Reporter:  olemis  |    Owner:
      Type:  defect  |   Status:  new
  Priority:  major   |  Version:  0.8.0dev
Resolution:          |
---------------------+--------------------
 Steps to reproduce the issue :

 {{{#!sh

 $ /srv/venv/bh/trunk/bin/python
 Python 2.7.4 (default, Sep 26 2013, 03:20:26)
 [GCC 4.7.3] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from trac.env import open_environment as oe
 >>> env = oe('/path/to/env')
 >>> from trac.resource import Neighborhood as N, Resource as R,
 get_resource_name, get_resource_description, get_resource_shortname
 >>> r = N('product', 'asdf')('ticket', 1)
 >>> r
 <Resource u'ticket:1' in Neighborhood product:asdf>
 >>> get_resource_name(env, r)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/path/to/bh/trac/trac/resource.py", line 682, in get_resource_name
     return get_resource_description(env, resource)
   File "/path/to/bh/trac/trac/resource.py", line 673, in
 get_resource_description
     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
 UnboundLocalError: local variable 'rsys' referenced before assignment
 >>> get_resource_description(env, r)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/path/to/bh/trac/trac/resource.py", line 673, in
 get_resource_description
     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
 UnboundLocalError: local variable 'rsys' referenced before assignment
 >>> get_resource_shortname(env, r)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/path/to/bh/trac/trac/resource.py", line 685, in
 get_resource_shortname
     return get_resource_description(env, resource, 'compact')
   File "/path/to/bh/trac/trac/resource.py", line 673, in
 get_resource_description
     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
 UnboundLocalError: local variable 'rsys' referenced before assignment
 }}}

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/751>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #751: UnboundLocalError: local variable 'rsys' referenced before assignment

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#751: UnboundLocalError: local variable 'rsys' referenced before assignment
------------------------+-----------------------
  Reporter:  olemis     |      Owner:
      Type:  defect     |     Status:  review
  Priority:  critical   |  Milestone:  Release 8
 Component:  trac core  |    Version:  0.8.0dev
Resolution:             |   Keywords:  resources
------------------------+-----------------------
Changes (by olemis):

 * owner:  olemis =>
 * status:  accepted => review


-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/751#comment:4>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #751: UnboundLocalError: local variable 'rsys' referenced before assignment

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#751: UnboundLocalError: local variable 'rsys' referenced before assignment
------------------------+-----------------------
  Reporter:  olemis     |      Owner:  olemis
      Type:  defect     |     Status:  accepted
  Priority:  critical   |  Milestone:  Release 8
 Component:  trac core  |    Version:  0.8.0dev
Resolution:             |   Keywords:  resources
------------------------+-----------------------
Changes (by olemis):

 * owner:  nobody => olemis
 * status:  new => accepted
 * milestone:   => Release 8


-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/751#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #751: UnboundLocalError: local variable 'rsys' referenced before assignment

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#751: UnboundLocalError: local variable 'rsys' referenced before assignment
------------------------+-----------------------
  Reporter:  olemis     |      Owner:  nobody
      Type:  defect     |     Status:  new
  Priority:  critical   |  Milestone:
 Component:  trac core  |    Version:  0.8.0dev
Resolution:             |   Keywords:  resources
------------------------+-----------------------
Changes (by olemis):

 * keywords:   => resources
 * owner:   => nobody
 * component:   => trac core
 * priority:  major => critical


Old description:

> Steps to reproduce the issue :
>
> {{{#!sh
>
> $ /srv/venv/bh/trunk/bin/python
> Python 2.7.4 (default, Sep 26 2013, 03:20:26)
> [GCC 4.7.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from trac.env import open_environment as oe
> >>> env = oe('/path/to/env')
> >>> from trac.resource import Neighborhood as N, Resource as R,
> get_resource_name, get_resource_description, get_resource_shortname
> >>> r = N('product', 'asdf')('ticket', 1)
> >>> r
> <Resource u'ticket:1' in Neighborhood product:asdf>
> >>> get_resource_name(env, r)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/path/to/bh/trac/trac/resource.py", line 682, in
> get_resource_name
>     return get_resource_description(env, resource)
>   File "/path/to/bh/trac/trac/resource.py", line 673, in
> get_resource_description
>     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
> UnboundLocalError: local variable 'rsys' referenced before assignment
> >>> get_resource_description(env, r)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/path/to/bh/trac/trac/resource.py", line 673, in
> get_resource_description
>     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
> UnboundLocalError: local variable 'rsys' referenced before assignment
> >>> get_resource_shortname(env, r)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/path/to/bh/trac/trac/resource.py", line 685, in
> get_resource_shortname
>     return get_resource_description(env, resource, 'compact')
>   File "/path/to/bh/trac/trac/resource.py", line 673, in
> get_resource_description
>     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
> UnboundLocalError: local variable 'rsys' referenced before assignment
> }}}

New description:

 Steps to reproduce the issue :

 {{{#!sh

 $ python
 Python 2.7.4 (default, Sep 26 2013, 03:20:26)
 [GCC 4.7.3] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from trac.env import open_environment as oe
 >>> env = oe('/path/to/env')
 >>> from trac.resource import Neighborhood as N, Resource as R,
 get_resource_name, get_resource_description, get_resource_shortname
 >>> r = N('product', 'asdf')('ticket', 1)
 >>> r
 <Resource u'ticket:1' in Neighborhood product:asdf>
 >>> get_resource_name(env, r)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/path/to/bh/trac/trac/resource.py", line 682, in get_resource_name
     return get_resource_description(env, resource)
   File "/path/to/bh/trac/trac/resource.py", line 673, in
 get_resource_description
     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
 UnboundLocalError: local variable 'rsys' referenced before assignment
 >>> get_resource_description(env, r)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/path/to/bh/trac/trac/resource.py", line 673, in
 get_resource_description
     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
 UnboundLocalError: local variable 'rsys' referenced before assignment
 >>> get_resource_shortname(env, r)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/path/to/bh/trac/trac/resource.py", line 685, in
 get_resource_shortname
     return get_resource_description(env, resource, 'compact')
   File "/path/to/bh/trac/trac/resource.py", line 673, in
 get_resource_description
     nbhprefix = rsys.neighborhood_prefix(resource.neighborhood)
 UnboundLocalError: local variable 'rsys' referenced before assignment
 }}}

--

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/751#comment:1>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #751: UnboundLocalError: local variable 'rsys' referenced before assignment

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#751: UnboundLocalError: local variable 'rsys' referenced before assignment
------------------------+-----------------------
  Reporter:  olemis     |      Owner:  olemis
      Type:  defect     |     Status:  closed
  Priority:  critical   |  Milestone:  Release 8
 Component:  trac core  |    Version:  0.8.0dev
Resolution:  fixed      |   Keywords:  resources
------------------------+-----------------------
Changes (by rjollos):

 * owner:   => olemis


-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/751#comment:6>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #751: UnboundLocalError: local variable 'rsys' referenced before assignment

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#751: UnboundLocalError: local variable 'rsys' referenced before assignment
------------------------+-----------------------
  Reporter:  olemis     |      Owner:  olemis
      Type:  defect     |     Status:  accepted
  Priority:  critical   |  Milestone:  Release 8
 Component:  trac core  |    Version:  0.8.0dev
Resolution:             |   Keywords:  resources
------------------------+-----------------------

Comment (by olemis):

 Submitted patch will fix this issue , please review . Details

 {{{#!sh

 $ hg qapplied
 t751/t751_r1563594_localvar_error.diff

 $ hg log -r qparent --template="{svnrev}\n"
 1563594
 }}}

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/751#comment:3>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #751: UnboundLocalError: local variable 'rsys' referenced before assignment

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#751: UnboundLocalError: local variable 'rsys' referenced before assignment
------------------------+-----------------------
  Reporter:  olemis     |      Owner:
      Type:  defect     |     Status:  closed
  Priority:  critical   |  Milestone:  Release 8
 Component:  trac core  |    Version:  0.8.0dev
Resolution:  fixed      |   Keywords:  resources
------------------------+-----------------------
Changes (by rjollos):

 * status:  review => closed
 * resolution:   => fixed


Comment:

 (In [1566993])

 0.8dev: Instantiate environment's `ResourceSystem` if neighborhood is not
 found. Refs #751.

 Patch by Olemis Lang.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/751#comment:5>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker