Archaeopteryx Software, Inc.
Take Flight!Search

Wing IDE
About Us
Open Source

 Advanced Search

[wingide-users] Re: Wing and Source is not synchronised.

Stephan R.A. Deibel
Wed, 14 Nov 2001 13:09:27 -0500 (EST)

On Wed, 14 Nov 2001, Robert Rottermann wrote:
> Sorry for not being precise enough.
> It is the trace-indictor (the reddish bar) that indicates what the  position
> of the execution pointer is that is not synchronized with the source.
> After much restarting of Zope and Wing things are fine again.
> Can I force to reload a file without closing and reopening?

There's no way to force a reload at this point... we should add this as
it could be useful after nixing a reload request.

However, in this case, assuming you're not running with unsaved files open
in Wing, I'm almost 100% certain the problem is not that you're seeing the
wrong version of the source file in Wing but that you're running the wrong
version of the code in Zope.  This can be caused by a number of things:

1) The Reload Product might fail to completely reload the module you've
   altered (this would be cleared up by restarting Zope)

2) Some date/time confusion or other factor such as win32 file locking
   may cause Python to fail to regenerate the *.pyc file file for an 
   altered *.py (this would explain a situation where restarting 
   Zope doesn't help)

3) Wing might end up showing an entirely incorrect source file in 
   certain rare cases (not just the wrong version but another file
   of the same name).

Solving (1) is hard, if you're really up against the limits of reload().
For example, if you're somehow executing code accessed by a stored code
object reference that came from the module before reload.  In that case,
you would be executing old code and not updated code.  As far as I
understand Zope's Reload and the way Products are designed, this shouldn't
happen but there might be ways to concoct such a scenarios within the
constraints on Products.

If you find that you do need to restart Zope a lot, take a look at
Debugging Faster with ZServer / Managing ZServer Restarts section in the
Zope + Wing HOW-TO:

(2) actually seems unlikely.  I've seen something like this once in a
great while but I believe only with Python 1.5.2 and usually only after
using or similar tools that muck with the pyc file.

For (3), see section 6.16 in the debugger chapter of the manual for a list
of cases that can mess up the debugger:

Hope that helps... if not, please let me know.


- Stephan

Run by Mailman v 2.0.8

Copyright (c) 2000-2002, Archaeopteryx Software, Inc.
Legal Statements