Bugs in rev 4336 mpl svn

Some recent changes (in the last few days) have caused my build to break. Three things:

First of all, the line in setupext.py: if version.version.endswith('mpl'):
fails. I can comment this block out, and set the return of check_provide_traits(): to True, and things seem to work well.

Second, I get this error:

2007-11-16 16:53:25.881 Python[6935] *** _NSAutoreleaseNoPool(): Object 0x18081c10 of class NSCarbonWindowContentView autoreleased with no pool in place - just leaking

when plotting text to the screen. I am using mathtext with the Arev Sans fonts.

Third, keypress events seem to be broken.

I am using Mac OS 10.4 with the TkAgg backend.

I'm sorry that I'm only posting problems and not posting more fixes, but I don't have enough time right now to track these things down at the moment, and wanted to get the word out quickly. Perhaps if there are still issues next week, I can check into these issues a bit more deeply.

-Rob

···

----
Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331

Hi Rob,

···

On Friday 16 November 2007 11:14:50 am Rob Hetland wrote:

Some recent changes (in the last few days) have caused my build to
break. Three things:

First of all, the line in setupext.py: if version.version.endswith
('mpl'):
fails. I can comment this block out, and set the return of
check_provide_traits(): to True, and things seem to work well.

I'm surprised by that failure, but need some more information to fix it. What
is the type and value of version.version on your machine? What specifically
did you block out to make it work?

Thanks,
Darren

Hi Rob,

Some recent changes (in the last few days) have caused my build to
break. Three things:

First of all, the line in setupext.py: if version.version.endswith
('mpl'):
fails. I can comment this block out, and set the return of
check_provide_traits(): to True, and things seem to work well.

I'm surprised by that failure, but need some more information to fix it. What
is the type and value of version.version on your machine? What specifically
did you block out to make it work?

The exact error is:

EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
              configobj: matplotlib will provide
Traceback (most recent call last):
   File "setup.py", line 234, in <module>
     if check_provide_traits(): build_traits(ext_modules, packages)
   File "/Users/rob/src/python/matplotlib/matplotlib/setupext.py", line 468, in check_provide_traits
     if version.version.endswith('mpl'):
AttributeError: 'module' object has no attribute 'version'

The problem is that my enthough.traits.version has no version attribute:

···

On Nov 16, 2007, at 6:10 PM, Darren Dale wrote:

On Friday 16 November 2007 11:14:50 am Rob Hetland wrote:

>>> from enthought.traits import version
>>> version.version
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)

/Users/rob/<ipython console> in <module>()

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

To make it work, I changed this:

def check_provide_traits():
     if options['provide_traits'] is True:
         print_status("enthought.traits", "matplotlib will provide")
         return True
     try:
         from enthought import traits
         try:
             from enthought.traits import version
         except:
             print_status("enthought.traits", "unknown and incompatible version: < 2.0")
             return False
         else:
             if version.version.endswith('mpl'):
                 print_status("enthought.traits", "matplotlib will provide")
                 return True
             else:
                 print_status("enthought.traits", version.version)
                 return False
     except ImportError:
         if options['provide_traits']:
             print_status("enthought.traits", "matplotlib will provide")
             return True
         else:
             print_status("enthought.traits", "no")
             return False

To this:

def check_provide_traits():
     if options['provide_traits'] is True:
         print_status("enthought.traits", "matplotlib will provide")
         return True
     try:
         from enthought import traits
         try:
             from enthought.traits import version
         except:
             print_status("enthought.traits", "unknown and incompatible version: < 2.0")
             return False
         else:
             # if version.version.endswith('mpl'):
             # print_status("enthought.traits", "matplotlib will provide")
             # return True
             # else:
             # print_status("enthought.traits", version.version)
             # return False
             return True
     except ImportError:
         if options['provide_traits']:
             print_status("enthought.traits", "matplotlib will provide")
             return True
         else:
             print_status("enthought.traits", "no")
             return False

I'm not sure if this is the _really_ right thing to do, but it does compile fine after this change, and I assume the answer (True) is the right one.

-Rob

----
Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331

Ok, it looks like I haven't covered all the possible variations in the traits
API yet. What version of traits are you using? Would you send me a copy of
your version.py file off list?

Thanks,
Darren

···

On Friday 16 November 2007 01:46:25 pm Rob Hetland wrote:

On Nov 16, 2007, at 6:10 PM, Darren Dale wrote:
> Hi Rob,
>
> On Friday 16 November 2007 11:14:50 am Rob Hetland wrote:
>> Some recent changes (in the last few days) have caused my build to
>> break. Three things:
>>
>> First of all, the line in setupext.py: if version.version.endswith
>> ('mpl'):
>> fails. I can comment this block out, and set the return of
>> check_provide_traits(): to True, and things seem to work well.
>
> I'm surprised by that failure, but need some more information to
> fix it. What
> is the type and value of version.version on your machine? What
> specifically
> did you block out to make it work?

The exact error is:

EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
              configobj: matplotlib will provide
Traceback (most recent call last):
   File "setup.py", line 234, in <module>
     if check_provide_traits(): build_traits(ext_modules, packages)
   File "/Users/rob/src/python/matplotlib/matplotlib/setupext.py",
line 468, in check_provide_traits
     if version.version.endswith('mpl'):
AttributeError: 'module' object has no attribute 'version'

The problem is that my enthough.traits.version has no version attribute:
>>> from enthought.traits import version
>>> version.version

------------------------------------------------------------------------
---
AttributeError Traceback (most recent call
last)

/Users/rob/<ipython console> in <module>()

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

Darren Dale fixed the first of my three bugs, despite some misinformation from me... Thanks, Darren.

Second, I get this error:

2007-11-16 16:53:25.881 Python[6935] *** _NSAutoreleaseNoPool():
Object 0x18081c10 of class NSCarbonWindowContentView autoreleased
with no pool in place - just leaking

when plotting text to the screen. I am using mathtext with the Arev
Sans fonts.

A clarification. I used debug-annoying to find out that it is probably not the fonts that cause this error. And I also get it when using Qt4. An excerpt of the output is below

Third, keypress events seem to be broken.

I wasn't able to make any progress finding out the cause of this problem, unfortunately. Debug gives no information when a key is pressed, so apparently the key presses don't make it too far into the system..

-Rob

>>> plot(random.rand(10))
FigureCanvasAgg.draw
RendererAgg.__init__
RendererAgg.__init__ width=640.0, height=480.0
RendererAgg.__init__ _RendererAgg done
RendererAgg.__init__ done
2007-11-17 18:23:45.474 Python[9859] *** _NSAutoreleaseNoPool(): Object 0x18081b80 of class NSCarbonWindowContentView autoreleased with no pool in place - just leaking
FigureCanvasAgg.draw
RendererAgg.__init__
RendererAgg.__init__ width=654.0, height=494.0
RendererAgg.__init__ _RendererAgg done
RendererAgg.__init__ done
FigureCanvasAgg.draw
[...more font stuff...]

···

On Nov 16, 2007, at 5:14 PM, Rob Hetland wrote:

----
Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331