hi jorge,

the problem seemed at first to be with zipped eggs, but now, after
i've unzipped them
all, i realize there is a problem with code frm peak/util/assembler.py.

it manifests with each launch of a debugged tg application.

for unzipping the eggs, i attach my utility to do that.

Traceback (most recent call last):
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 14353, in <module>
    ret = rpdb2.main()
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 14324, in main
    StartServer(_rpdb2_args, fchdir, _rpdb2_pwd, fAllowUnencrypted,
fAllowRemote, secret)
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 14074, in StartServer
    imp.load_source('__main__', _path)
  File "/srv/turbogears/resheteva/start-resheteva.py", line 11, in <module>
    from resheteva.commands import start, ConfigurationError
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 13372, in rpdb2_import_wrapper
    m = g_import(*args, **kwargs)
  File "/srv/turbogears/resheteva/resheteva/commands.py", line 12, in <module>
    import turbogears
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 13372, in rpdb2_import_wrapper
    m = g_import(*args, **kwargs)
  File 
"/usr/local/lib/python2.5/site-packages/TurboGears-1.1b1-py2.5.egg/turbogears/__init__.py",
line 6, in <module>
    from turbogears.controllers import expose, flash, validate, redirect, \
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 13372, in rpdb2_import_wrapper
    m = g_import(*args, **kwargs)
  File 
"/usr/local/lib/python2.5/site-packages/TurboGears-1.1b1-py2.5.egg/turbogears/controllers.py",
line 15, in <module>
    from peak.rules import abstract, Method, always_overrides
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 13372, in rpdb2_import_wrapper
    m = g_import(*args, **kwargs)
  File 
"/usr/local/lib/python2.5/site-packages/PEAK_Rules-0.5a1.dev_r2569-py2.5.egg/peak/rules/__init__.py",
line 3, in <module>
    from peak.rules.core import *
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 13372, in rpdb2_import_wrapper
    m = g_import(*args, **kwargs)
  File 
"/usr/local/lib/python2.5/site-packages/PEAK_Rules-0.5a1.dev_r2569-py2.5.egg/peak/rules/core.py",
line 10, in <module>
    from peak.util.assembler import Code, Const, Call, Local, Getattr,
TryExcept, Suite, with_name
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 13372, in rpdb2_import_wrapper
    m = g_import(*args, **kwargs)
  File 
"/usr/local/lib/python2.5/site-packages/BytecodeAssembler-0.5.1-py2.5.egg/peak/util/assembler.py",
line 452, in <module>
    class Label(object):
  File 
"/usr/local/lib/python2.5/site-packages/BytecodeAssembler-0.5.1-py2.5.egg/peak/util/assembler.py",
line 481, in Label
    locals()[opname[op]] = with_name(do_jump, opname[op])
  File 
"/usr/local/lib/python2.5/site-packages/BytecodeAssembler-0.5.1-py2.5.egg/peak/util/assembler.py",
line 444, in with_name
    return f
  File "/usr/local/lib/python2.5/site-packages/winpdb-1.4.0-py2.5.egg/rpdb2.py",
line 6380, in profile
    self.m_code_context = self.m_core.m_code_contexts[self.m_frame.f_code]
KeyError: <code object Label at 0x99c3338, file
"/usr/local/lib/python2.5/site-packages/BytecodeAssembler-0.5.1-py2.5.egg/peak/util/assembler.py",
line 452>


On Fri, Oct 31, 2008 at 05:37, alex bodnaru <[EMAIL PROTECTED]> wrote:
> hi jorge,
>
> thanks for your answer.
>
> On Fri, Oct 31, 2008 at 02:31, Jorge Vargas <[EMAIL PROTECTED]> wrote:
>>
>> On Thu, Oct 30, 2008 at 9:48 AM, alex bodnaru <[EMAIL PROTECTED]> wrote:
>>>
>>> hello friends,
>>>
>>> has anybody successfuly  used winpdb in turbogears?
>>>
>> not me.
>>> versions 1.36, 1.38, 1.40 crashed on me when debugging 
>>> turbogears/controllers.
>>>
>> could you paste the error msg crash? if it's TGs fault we could fix it.
>>
> it seems a queer feature of winpdb. i'll inquire there and post here
> the answers.
>
> alex
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

# unzip all egg files int appropriate directories. originals are kept as 
# *.eggz files

# copyright (c) alex bodnaru <[EMAIL PROTECTED]>
# released under either MIT or GPL, at your option

import sys, os, zipfile

python_version = '.'.join(sys.version.split(' ')[0].split('.')[0:2])
location = '/usr/local/lib/python%s/site-packages' % python_version

def mkdir_p(path, mode=0777):
    lpath = path.split('/')
    newpath = ''
    if lpath[0] == '':
        lpath[0] = os.path.sep
    for dir in lpath:
        newpath = os.path.join(newpath, dir)
        if not os.path.isdir(newpath):
            os.mkdir(newpath)

for eggname in os.listdir(location):
    fullname = os.path.join(location, eggname)
    if fullname.endswith('.eggz') and zipfile.is_zipfile(fullname):
        fullname = fullname[:-1]
    elif fullname.endswith('.egg') and zipfile.is_zipfile(fullname):
        os.rename(fullname, fullname + 'z')
    else: continue
    zip = zipfile.ZipFile(fullname + 'z')
    for file in zip.namelist():
        filename = os.path.join(fullname, file)
        dirname = os.path.dirname(filename)
        if not os.path.isdir(dirname):
            mkdir_p(dirname, 0755)
        fd = os.open(filename, os.O_WRONLY|os.O_TRUNC|os.O_CREAT, 0644)
        os.write(fd, zip.read(file))
        os.close(fd)
    zip.close()
    

Reply via email to