[Issues] pylab causes copy/paste limit of 510 characters

Hugo Buddelmeijer buddel at astro.rug.nl
Fri May 15 13:56:14 CEST 2009


Hi,

I noticed an odd bug with pasting pieces of code in the Astro-WISE 
prompt, sometimes it misses characters. This seems to be related to 
pylab, as demonstrated by this example:


# Start a new awe-prompt and copy and paste this piece of code, it should
# give you a length of 555 (there should be two lines, one very long):

a="012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234"
len(a)

# Then use pylab to plot something:

import pylab
pylab.plot([4,2,3,2,4])

# Close the graph window and (*important*) press a couple of enters, now
# paste the first piece of code again, you will get 554 for the length.


Testing showed that it is the 511th character that is being skipped. This 
limit is reachable with as few as 15 LoC. I have not been able to 
reproduce this on other python installations, albeit they all use newer 
versions of pylab/matplotlib.

Newer matplotlib versions also have other benefits, such as that they do 
not require a display since they only actually show figures when you do 
pylab.show(). Perhaps it is a good idea to upgrade to a newer matplotlib?

Hugo


More information about the Issues mailing list