Modify

Opened 16 years ago

Last modified 10 years ago

#4109 new defect

AttributeError: 'module' object has no attribute 'mknod'

Reported by: thesorcerer Owned by:
Priority: normal Component: SvnsyncPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Hi,

I get this error when I try to use svnsync-plugin on XP

Python Traceback Most recent call last:

  • File "C:\Python25\Lib\site-packages\trac\web\main.py", line 432, in _dispatch_request Code fragment:
    1. try:
    2. if not env and env_error:
    3. raise HTTPInternalError(env_error)
    4. try:
    5. dispatcher = RequestDispatcher(env)
    6. dispatcher.dispatch(req)
    7. except RequestDone:
    8. pass
    9. resp = req._response or []
    10. except HTTPException, e:
    Local variables: Name Value after [u' except RequestDone:', u' pass', u' resp = ... before [u' try:', u' if not env and env_error:', u' raise ... dispatcher <trac.web.main.RequestDispatcher object at 0x0167ED30> e AttributeError("'module' object has no attribute 'mknod'",) env <trac.env.Environment object at 0x016A9730> env_error None exc_info (<type 'exceptions.AttributeError'>, AttributeError("'module' object has ... filename 'C:
    Python25
    Lib
    site-packages
    trac
    web
    main.py' frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ... has_admin True line u' dispatcher.dispatch(req)' lineno 431 message u"AttributeError: 'module' object has no attribute 'mknod'" req <Request "GET u'/report'"> resp [] tb <traceback object at 0x01695148> tb_hide None traceback 'Traceback (most recent call last):\n File ...
  • File "C:\Python25\Lib\site-packages\trac\web\main.py", line 174, in dispatch Code fragment:
    1. if not req.path_info or req.path_info == '/':
    2. chosen_handler = self.default_handler
    3. # pre-process any incoming request, whether a handler
    4. # was found or not
    5. chosen_handler = self._pre_process_request(req,
    6. chosen_handler)
    7. except TracError, e:
    8. raise HTTPInternalError(e)
    9. if not chosen_handler:
    10. if req.path_info.endswith('/'):
    11. # Strip trailing / and redirect
    Local variables: Name Value chosen_handler <trac.ticket.report.ReportModule object at 0x0167EB50> chrome <trac.web.chrome.Chrome object at 0x0167E3F0> err (<type 'exceptions.AttributeError'>, AttributeError("'module' object has ... handler <trac.ticket.report.ReportModule object at 0x0167EB50> req <Request "GET u'/report'"> self <trac.web.main.RequestDispatcher object at 0x0167ED30>
  • File "C:\Python25\Lib\site-packages\trac\web\main.py", line 295, in _pre_process_request Code fragment:
    1. req.outcookietrac_form_token?secure? = True
    2. return req.outcookietrac_form_token?.value
    3. def _pre_process_request(self, req, chosen_handler):
    4. for filter_ in self.filters:
    5. chosen_handler = filter_.pre_process_request(req, chosen_handler)
    6. return chosen_handler
    7. def _post_process_request(self, req, *args):
    8. nbargs = len(args)
    9. resp = args
    Local variables: Name Value chosen_handler <trac.ticket.report.ReportModule object at 0x0167EB50> filter_ <trac.versioncontrol.api.RepositoryManager object at 0x0167E9B0> req <Request "GET u'/report'"> self <trac.web.main.RequestDispatcher object at 0x0167ED30>
  • File "C:\Python25\Lib\site-packages\trac\versioncontrol\api.py", line 86, in pre_process_request Code fragment:
    1. def pre_process_request(self, req, handler):
    2. from trac.web.chrome import Chrome, add_warning
    3. if handler is not Chrome(self.env):
    4. try:
    5. self.get_repository(req.authname).sync()
    6. except TracError, e:
    7. add_warning(req, _("Can't synchronize with the repository "
    8. "(%(error)s). Look in the Trac log for more "
    9. "information.", error=e.message)) 91.
    Local variables: Name Value Chrome <class 'trac.web.chrome.Chrome'> add_warning <function add_warning at 0x0118E330> handler <trac.ticket.report.ReportModule object at 0x0167EB50> req <Request "GET u'/report'"> self <trac.versioncontrol.api.RepositoryManager object at 0x0167E9B0>
  • File "C:\Python25\Lib\site-packages\trac\versioncontrol\api.py", line 157, in get_repository Code fragment:
    1. repos = self._cache[tid]
    2. else:
    3. rtype, rdir = self.repository_type, self.repository_dir
    4. if not os.path.isabs(rdir):
    5. rdir = os.path.join(self.env.path, rdir)
    6. repos = self._connector.get_repository(rtype, rdir, authname)
    7. self._cache[tid] = repos
    8. return repos
    9. finally:
    10. self._lock.release()
    Local variables: Name Value authname 'anonymous' candidates [(8, <svnsyncplugin.svnsyncplugin.SvnsyncConnector object at 0x0144B850>), ... connector <svnsyncplugin.svnsyncplugin.SvnsyncConnector object at 0x0144B850> db <trac.db.pool.PooledConnection object at 0x0168F508> prio 8 rdir u'C:
    ETAP_svnsyncrep' repos_type 'svnsync' rtype u'svnsync' self <trac.versioncontrol.api.RepositoryManager object at 0x0167E9B0> tid 2508
  • File "c:\python25\lib\site-packages\svnsyncplugin-0.1.2-py2.5.egg\svnsyncplugin\svnsyncplugin.py", line 35, in get_repository Code fragment:
    1. def get_repository(self, repos_type, repos_dir, authname):
    2. assert repos_type == 'svnsync'
    3. # sync the repository
    4. directory = self.env.config.get('trac', 'repository_dir')
    5. svnsync.sync(directory, self.repository_url, logger=self.env.log.info)
    6. repos = SubversionRepository(repos_dir, None, self.log)
    7. return repos 39.
    8. ### methods particular to SvnsyncConnector
    Local variables: Name Value authname 'anonymous' directory u'C:
    ETAP_svnsyncrep' repos_dir u'C:
    ETAP_svnsyncrep' repos_type u'svnsync' self <svnsyncplugin.svnsyncplugin.SvnsyncConnector object at 0x0144B850>
  • File "c:\python25\lib\site-packages\svnsyncplugin-0.1.2-py2.5.egg\svnsyncplugin\svnsync.py", line 82, in sync Code fragment:
    1. if logger:
    2. logger('repository changed! %s -> %s' % (url, repository.strip()))
    3. logger('resyncing to new repository')
    4. import shutil
    5. shutil.rmtree(directory)
    6. sync(directory, repository, username, logger=logger)
    7. return sh('svnsync', 'sync', repo, logger=logger)
    8. if name == 'main':
    9. import optparse
    Local variables: Name Value directory u'C:
    ETAP_svnsyncrep' logger <bound method Logger.info of <logging.Logger instance at 0x011FC3F0>> propget (, "svn: Unable to open an ra_local session to URL\r\nsvn: Unable to ... repo u'file:///C:/ETAP_svnsyncrep' repository u'P:
    ETAP_TDP1_2
    .repository' shutil <module 'shutil' from 'C:\Python25\lib\shutil.pyc'> url
    username 'svnsync'
  • File "c:\python25\lib\site-packages\svnsyncplugin-0.1.2-py2.5.egg\svnsyncplugin\svnsync.py", line 66, in sync Code fragment:
    1. def sync(directory, repository, username='svnsync', logger=None):
    2. # create the mirror if it doesn't exist
    3. if not os.path.exists(directory):
    4. retval = create(directory, repository, username, logger=logger)
    5. if retval[-1] != 0:
    6. return retval
    7. repo = file_uri(directory)
    Local variables: Name Value directory u'C:
    ETAP_svnsyncrep' logger <bound method Logger.info of <logging.Logger instance at 0x011FC3F0>> repository u'P:
    ETAP_TDP1_2
    .repository' username 'svnsync'
  • File "c:\python25\lib\site-packages\svnsyncplugin-0.1.2-py2.5.egg\svnsyncplugin\svnsync.py", line 49, in create Code fragment:
    1. filename = 'pre-revprop-change'
    2. if os in windows:
    3. filename += '.bat'
    4. filename = os.path.join(directory, 'hooks', filename)
    5. os.mknod(filename, 0770)
    6. f = file(filename, 'w')
    7. if os in windows:
    8. print >> f,
    9. else:
    10. print >> f, '#!/bin/sh'
    Local variables: Name Value directory u'C:
    ETAP_svnsyncrep' filename u'C:
    ETAP_svnsyncrep
    hooks
    pre-revprop-change' logger <bound method Logger.info of <logging.Logger instance at 0x011FC3F0>> repository u'P:
    ETAP_TDP1_2
    .repository' username 'svnsync'

File "C:\Python25\Lib\site-packages\trac\web\main.py", line 432, in _dispatch_request

dispatcher.dispatch(req)

File "C:\Python25\Lib\site-packages\trac\web\main.py", line 174, in dispatch

chosen_handler)

File "C:\Python25\Lib\site-packages\trac\web\main.py", line 295, in _pre_process_request

chosen_handler = filter_.pre_process_request(req, chosen_handler)

File "C:\Python25\Lib\site-packages\trac\versioncontrol\api.py", line 86, in pre_process_request

self.get_repository(req.authname).sync()

File "C:\Python25\Lib\site-packages\trac\versioncontrol\api.py", line 157, in get_repository

repos = self._connector.get_repository(rtype, rdir, authname)

File "c:\python25\lib\site-packages\svnsyncplugin-0.1.2-py2.5.egg\svnsyncplugin\svnsyncplugin.py", line 35, in get_repository

svnsync.sync(directory, self.repository_url, logger=self.env.log.info)

File "c:\python25\lib\site-packages\svnsyncplugin-0.1.2-py2.5.egg\svnsyncplugin\svnsync.py", line 82, in sync

sync(directory, repository, username, logger=logger)

File "c:\python25\lib\site-packages\svnsyncplugin-0.1.2-py2.5.egg\svnsyncplugin\svnsync.py", line 66, in sync

retval = create(directory, repository, username, logger=logger)

File "c:\python25\lib\site-packages\svnsyncplugin-0.1.2-py2.5.egg\svnsyncplugin\svnsync.py", line 49, in create

os.mknod(filename, 0770)

System Information: Trac: 0.11.2 Python: 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] setuptools: 0.6c9 SQLite: 3.3.4 pysqlite: 2.3.2 Genshi: 0.5 Pygments: 0.11.1 jQuery: 1.2.6

Attachments (0)

Change History (6)

comment:1 Changed 16 years ago by thesorcerer

The problem seems to be os.mknod, but this should be available for Python 2.5.

Or is this a Windows issue?

comment:2 Changed 16 years ago by Jeff Hammel

guessing windows? haven't had a chance to look yet, though

comment:3 Changed 16 years ago by thesorcerer

Any additional info I could provide or anything I should check or test?

comment:4 Changed 16 years ago by thesorcerer

Any hints on this topic?

comment:5 in reply to:  4 Changed 16 years ago by anonymous

Replying to thesorcerer:

Any hints on this topic?

I haven't had a chance to look into it yet. There may be a workaround for windows, but I haven't investigated.

comment:6 Changed 10 years ago by Ryan J Ollos

Owner: Jeff Hammel deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.