Bug 1047238 - python-matplotlib-1.3.0-1 ax.text() function treats space characters as NUL
Summary: python-matplotlib-1.3.0-1 ax.text() function treats space characters as NUL
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: python-matplotlib
Version: 20
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jef Spaleta
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-30 03:52 UTC by bob
Modified: 2015-06-29 13:56 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-06-29 13:56:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
short sample of code to produce error (966 bytes, text/x-python)
2014-04-02 21:01 UTC, bob
no flags Details
sample image demonstrating bug (21.91 KB, image/png)
2014-04-02 21:02 UTC, bob
no flags Details

Description bob 2013-12-30 03:52:51 UTC
Description of problem:

python-matplotlib's ax.text() function is making errors in parsing the text-character parameter for the function.  It is misinterpreting a string comprised of ASCII space characters plus linefeed characters as a NUL string.

According to python programming standards, any character other than "{" and "}" are valid fill characters.  In this context, using an ASCII space character " " to pad-fill the content of a text string should be interpreted as a valid string.  

In my case, I am passing a padded string of 30 space characters plus a linefeed "\n" as the text parameter, and ax.text() is misinterpreting the spaces-plus-linefeed string as a NUL string. 

Further, when this character string is replicated, in order to produce several lines of blank text with linefeeds, in order to draw an empty box, ax.text() responds by interpreting all of the lines of blank text with linefeed characters as a single NUL string.  In doing this, ax.text() interprets the desired string length to be zero and it fails to draw a properly-sized empty box; it responds by drawing a box that is zero characters in width and zero lines in height; essentially, ax.text() fails to draw any box when it receives what it thinks is a NUL string.

I can work around this bug by placing any text character anywhere in the space-padded string.  ax.text() then interprets the string as being other than NUL and draws an appropriate box.

This mis-recognition of the space character as a valid padding character is new bug in matplotlib 1.3.0-1.  The functionality in parsing this type of string was working properly in python-matplotlib-1.2.0-14.fc18.x86_64.  I only noticed the code breaking upon upgrading form F18 to F20 today.


Version-Release number of selected component (if applicable):

python-matplotlib-1.3.0-1.fc20.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Create a string comprised of space characters (add \n to the end if you like)
2. Pass the string to ax.text()
3. 

Actual results:

ax.text() interprets the space-padded string as a NUL string and draws no text box.

Expected results:

ax.text() interprets the space-padded string as spaces, and draws an appropriately sized empty box.

Additional info:

Comment 1 bob 2014-04-02 21:01:13 UTC
Created attachment 882006 [details]
short sample of code to produce error

Comment 2 bob 2014-04-02 21:02:42 UTC
Created attachment 882007 [details]
sample image demonstrating bug

Comment 3 bob 2014-04-02 21:06:37 UTC
The sample python code should draw three boxes, but only the first and third boxes are properly drawn.  the code to draw second box fails to draw the box because the properly formatted code is being misinterpreted by matplotlib's box drawing function.  the misinterpretation occurs when matplotlib reads a properly formatted python string comprised of space characters, and improperly interprets the string of space characters as nul input.  According to python string formatting standards, the SPACE character is a legitimate padding character.  Unfortunately, matplotlib sees a string that is comprised of SPACE characters, and misinterprets the legitimate string to be NUL input.

Comment 4 Fedora End Of Life 2015-05-29 10:13:53 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2015-06-29 13:56:19 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.