[Numpy-discussion] distutils issue - python 3.1 on windows
Wed Aug 4 10:34:15 CDT 2010
On Wed, Aug 4, 2010 at 6:25 AM, Pauli Virtanen <email@example.com> wrote:
> Mon, 02 Aug 2010 23:48:52 +0800, Ralf Gommers wrote:
> > I'm trying to get building to work with Python 3.1 under Wine on OS X.
> > The first thing you run into is a python distutils problem, which is
> > fixed by replacing line 379 of cygwinccompiler.py with
> > result = RE_VERSION.search(str(out_string))
> Ah yep, cygwinccompiler.py is in Python's distutils, I wondered for a
> while where the bug was :)
> But actually, I'm now looking at the cygwinccompiler.py source code, and
> to me it seems it should be ok. The RE_VERSION is a byte-regular
> expression, so it's not obvious why making the input a str would help?
> I haven't started using py3k yet so I'm still a bit fuzzy about bytes vs
string. But it's easy to try in the interpreter:
>>> import re
>>> RE_VERSION = re.compile('(\d+\.\d+(\.\d+)*)')
>>> cmd = "gcc -dumpversion"
>>> from subprocess import Popen, PIPE
>>> out = Popen(cmd, shell=True, stdout=PIPE).stdout
>>> out_string = out.read()
>>> result = RE_VERSION.search(out_string)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't use a string pattern on a bytes-like object
> > File
> > "Z:\Users\rgommers\Code\numpy\build\py3k\numpy\distutils
> > line 177, in link
> > func(*args[:func.__func__.__code__.co_argcount])
> > AttributeError: 'function' object has no attribute '__func__'
> I fixed this in trunk r8595 (cherry-pick to 1.5.x if you find it works).
That works, thanks. Then there's was still one more problem, _dotblas.c was
not py3k ready. With this fix I can build everything under Wine:
Does that look fine?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion