NetBSD Problem Report #53425

From gson@gson.org  Wed Jul  4 09:47:03 2018
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id BA19E7A172
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  4 Jul 2018 09:47:03 +0000 (UTC)
Message-Id: <20180704094656.669AC9896A2@guava.gson.org>
Date: Wed,  4 Jul 2018 12:46:56 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: graphics/py-matplotlib 2.2.2 import fails
X-Send-Pr-Version: 3.95

>Number:         53425
>Category:       pkg
>Synopsis:       graphics/py-matplotlib 2.2.2 import fails
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          pending-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 04 09:50:00 +0000 2018
>Closed-Date:    
>Last-Modified:  Thu Jul 12 19:50:01 +0000 2018
>Originator:     Andreas Gustafsson
>Release:        NetBSD 7.1_STABLE; also -current
>Organization:

>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

With graphics/py-matplotlib 2.2.2, attempting to import
matplotlib.pyplot fails with the following backtrace:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/pkg/lib/python2.7/site-packages/matplotlib/pyplot.py", line 31, in <module>
    import matplotlib.colorbar
  File "/usr/pkg/lib/python2.7/site-packages/matplotlib/colorbar.py", line 36, in <module>
    import matplotlib.contour as contour
  File "/usr/pkg/lib/python2.7/site-packages/matplotlib/contour.py", line 20, in <module>
    import matplotlib.font_manager as font_manager
  File "/usr/pkg/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1469, in <module>
    _rebuild()
  File "/usr/pkg/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1450, in _rebuild
    fontManager = FontManager()
  File "/usr/pkg/lib/python2.7/site-packages/matplotlib/font_manager.py", line 1086, in __init__
    self.ttflist = createFontList(self.ttffiles)
  File "/usr/pkg/lib/python2.7/site-packages/matplotlib/font_manager.py", line 587, in createFontList
    font = ft2font.FT2Font(fpath)
TypeError: First argument must be a path or file object reading bytes

>How-To-Repeat:

Install graphics/py-matplotlib from current pkgsrc and run

  /usr/pkg/bin/python2.7 -c 'import matplotlib.pyplot'

>Fix:

>Release-Note:

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53425: graphics/py-matplotlib 2.2.2 import fails
Date: Wed, 4 Jul 2018 10:47:48 +0000

 Well there's your problem, in fc-list:

 #ifdef linux
 #define HAVE_GETOPT_LONG 1
 #endif

 and it doesn't have fc-list --format on non-linux.
 -f should be equivalent. Should patch it.

From: maya@netbsd.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/53425: graphics/py-matplotlib 2.2.2 import fails
Date: Wed, 4 Jul 2018 11:14:27 +0000

 well, there's one of your problems, that isn't sufficient to fix it. But
 here is a patch.

 --- lib/matplotlib/font_manager.py.orig	2018-03-17 18:03:23.000000000 +0000
 +++ lib/matplotlib/font_manager.py
 @@ -279,7 +279,7 @@ def _call_fc_list():
          'This may take a moment.'))
      timer.start()
      try:
 -        out = subprocess.check_output([str('fc-list'), '--format=%{file}\\n'])
 +        out = subprocess.check_output([str('fc-list'), '-f %{file}\\n'])
      except (OSError, subprocess.CalledProcessError):
          return []
      finally:

From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53425 CVS commit: src/external/mit/xorg/bin
Date: Wed, 4 Jul 2018 12:25:49 +0000

 Module Name:	src
 Committed By:	maya
 Date:		Wed Jul  4 12:25:49 UTC 2018

 Modified Files:
 	src/external/mit/xorg/bin/fc-cache: Makefile
 	src/external/mit/xorg/bin/fc-cat: Makefile
 	src/external/mit/xorg/bin/fc-list: Makefile
 	src/external/mit/xorg/bin/fc-match: Makefile
 	src/external/mit/xorg/bin/fc-pattern: Makefile
 	src/external/mit/xorg/bin/fc-query: Makefile
 	src/external/mit/xorg/bin/fc-scan: Makefile
 	src/external/mit/xorg/bin/fc-validate: Makefile

 Log Message:
 Claim to have getopt_long.

 We do, and packages occasionally expect the long options to exist.
 Pointed out while investigating
 PR pkg/53425: graphics/py-matplotlib 2.2.2 import fails
 (which is not fixed by this commit)


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/fc-cache/Makefile
 cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/fc-cat/Makefile
 cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/fc-list/Makefile
 cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/fc-match/Makefile
 cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/fc-pattern/Makefile
 cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/fc-query/Makefile
 cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/fc-scan/Makefile
 cvs rdiff -u -r1.1 -r1.2 src/external/mit/xorg/bin/fc-validate/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Andreas Gustafsson" <gson@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53425 CVS commit: pkgsrc/graphics
Date: Wed, 11 Jul 2018 16:19:32 +0000

 Module Name:	pkgsrc
 Committed By:	gson
 Date:		Wed Jul 11 16:19:32 UTC 2018

 Modified Files:
 	pkgsrc/graphics/py-matplotlib: Makefile distinfo
 	pkgsrc/graphics/py-matplotlib-gtk2: Makefile
 	pkgsrc/graphics/py-matplotlib-tk: Makefile
 Added Files:
 	pkgsrc/graphics/py-matplotlib/patches: patch-src_file__compat.h

 Log Message:
 py-matplotlib: fix PR 53425

 Don't call fflush() on a read-only file pointer; it is an error on BSD
 systems and causes the import of matplotlib.pyplot to fail.


 To generate a diff of this commit:
 cvs rdiff -u -r1.52 -r1.53 pkgsrc/graphics/py-matplotlib/Makefile
 cvs rdiff -u -r1.30 -r1.31 pkgsrc/graphics/py-matplotlib/distinfo
 cvs rdiff -u -r1.66 -r1.67 pkgsrc/graphics/py-matplotlib-gtk2/Makefile
 cvs rdiff -u -r1.33 -r1.34 pkgsrc/graphics/py-matplotlib-tk/Makefile
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/graphics/py-matplotlib/patches/patch-src_file__compat.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/53425: graphics/py-matplotlib 2.2.2 import fails
Date: Wed, 11 Jul 2018 20:01:31 +0300

 Reported upstream as:
 https://github.com/matplotlib/matplotlib/issues/1163
 -- 
 Andreas Gustafsson, gson@gson.org

State-Changed-From-To: open->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Wed, 11 Jul 2018 17:12:04 +0000
State-Changed-Why:
Should work now.


State-Changed-From-To: closed->pending-pullups
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Wed, 11 Jul 2018 17:58:34 +0000
State-Changed-Why:
pullup-pkgsrc #5782


From: "S.P.Zeidler" <spz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53425 CVS commit: [pkgsrc-2018Q2] pkgsrc/graphics
Date: Thu, 12 Jul 2018 19:47:38 +0000

 Module Name:	pkgsrc
 Committed By:	spz
 Date:		Thu Jul 12 19:47:38 UTC 2018

 Modified Files:
 	pkgsrc/graphics/py-matplotlib [pkgsrc-2018Q2]: Makefile distinfo
 	pkgsrc/graphics/py-matplotlib-gtk2 [pkgsrc-2018Q2]: Makefile
 	pkgsrc/graphics/py-matplotlib-tk [pkgsrc-2018Q2]: Makefile
 Added Files:
 	pkgsrc/graphics/py-matplotlib/patches [pkgsrc-2018Q2]:
 	    patch-src_file__compat.h

 Log Message:
 Pullup ticket #5782 - requested by bsiegert
 graphics/py-matplotlib: functionality patch
 graphics/py-matplotlib-gtk2: functionality patch
 graphics/py-matplotlib-tk: functionality patch

 Revisions pulled up:
 - graphics/py-matplotlib-gtk2/Makefile                          1.67
 - graphics/py-matplotlib-tk/Makefile                            1.34
 - graphics/py-matplotlib/Makefile                               1.53
 - graphics/py-matplotlib/distinfo                               1.31
 - graphics/py-matplotlib/patches/patch-src_file__compat.h       1.1

 -------------------------------------------------------------------
    Module Name:   pkgsrc
    Committed By:  gson
    Date:          Wed Jul 11 16:19:32 UTC 2018

    Modified Files:
           pkgsrc/graphics/py-matplotlib: Makefile distinfo
           pkgsrc/graphics/py-matplotlib-gtk2: Makefile
           pkgsrc/graphics/py-matplotlib-tk: Makefile
    Added Files:
           pkgsrc/graphics/py-matplotlib/patches: patch-src_file__compat.h

    Log Message:
    py-matplotlib: fix PR 53425

    Don't call fflush() on a read-only file pointer; it is an error on BSD
    systems and causes the import of matplotlib.pyplot to fail.

    To generate a diff of this commit:
    cvs rdiff -u -r1.52 -r1.53 pkgsrc/graphics/py-matplotlib/Makefile
    cvs rdiff -u -r1.30 -r1.31 pkgsrc/graphics/py-matplotlib/distinfo
    cvs rdiff -u -r1.66 -r1.67 pkgsrc/graphics/py-matplotlib-gtk2/Makefile
    cvs rdiff -u -r1.33 -r1.34 pkgsrc/graphics/py-matplotlib-tk/Makefile
    cvs rdiff -u -r0 -r1.1 \
        pkgsrc/graphics/py-matplotlib/patches/patch-src_file__compat.h


 To generate a diff of this commit:
 cvs rdiff -u -r1.52 -r1.52.2.1 pkgsrc/graphics/py-matplotlib/Makefile
 cvs rdiff -u -r1.30 -r1.30.2.1 pkgsrc/graphics/py-matplotlib/distinfo
 cvs rdiff -u -r1.66 -r1.66.2.1 pkgsrc/graphics/py-matplotlib-gtk2/Makefile
 cvs rdiff -u -r1.33 -r1.33.2.1 pkgsrc/graphics/py-matplotlib-tk/Makefile
 cvs rdiff -u -r0 -r1.1.2.2 \
     pkgsrc/graphics/py-matplotlib/patches/patch-src_file__compat.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.