tags 399751 + upstream
tags 399751 + patch
thanks

Hello!

Cc:ing upstream author, since this bug is clearly upstream and I'd
like his opinion about my patch.

On Tue, 21 Nov 2006 20:25:59 +0100, Philipp Kern wrote:
> darcsweb appends `/etc/darcsweb' to sys.path in line 29. This fails if
> another `config.py' is in the path before the one specifying darcs's
> configuration. In my case this was presumably
> `var/lib/python-support/python2.4/config.py'.

FWIW, here the output error:
=====
A problem occurred in a Python script. Here is the sequence of function \
 calls leading up to the error, in the order they occurred.

 /usr/lib/cgi-bin/darcsweb.cgi                                                  
                                                                                
        
 2340 # if they don't specify a repo, print the list and exit                   
                                                                                
        
 2341 if not form.has_key('r'):                                                 
                                                                                
        
 2342         fill_config()                                                     
                                                                                
        
 2343         do_listrepos()                                                    
                                                                                
        
 2344         log_times(cache_hit = 0, event = 'index')                         
                                                                                
        
fill_config = <function fill_config>                                            
                                                                                
        
 /usr/lib/cgi-bin/darcsweb.cgi in fill_config(name=None)                        
                                                                                
        
 2254                                                                           
                                                                                
        
 2255         # fill the configuration                                          
                                                                                
        
 2256         base = all_configs.base                                           
                                                                                
        
 2257         if 'myname' not in dir(base):                                     
                                                                                
        
 2258                 # SCRIPT_NAME has the full path, we only take the file 
name                                                                            
           
base undefined, all_configs = <module 'config' from \
 '/var/lib/python-support/python2.4/config.pyc'>, all_configs.base undefined    
                                     

AttributeError: 'module' object has no attribute 'base'
      args = ("'module' object has no attribute 'base'",)
=====

> Instead it should prepend the path to the variable.

Or, better, use a less generic name.

And while we're at here, I'd suggest to move the configuration to
/etc/darcswebconf.py (even if the best would be /etc/darcsweb.conf),
since AFAIK /etc/darcsweb/ contains config.py only.  Upstream patch
attached.

Thx, bye,
Gismo / Luca

Attachment: darcsweb_use-etc-darcswebconfpy-as-config_gismo-20071001.patch.gz
Description: use /etc/darcswebconf.py as configuration file

Reply via email to