[Cython] Cython 0.20 release candidates

2014-01-16 Thread Robert Bradshaw
Up at http://cython.org/release/Cython-0.20rc1.tar.gz , to be released shortly.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


[Cython] assignment to reference argument bug, revisited

2014-01-16 Thread Robert Byrnes
Are there any plans to fix the "Assignment to reference" bug mentioned here?

https://groups.google.com/forum/?fromgroups=#!topic/cython-users/j58Sp3QMrD4

> Oh, yes, of course. Good old C++, where local T& x is unassignable but
> assigning to an argument T& x is a common idiom. This is a bug in Cython.

This is still broken in 0.19.2, and a casual inspection of 0.20rc1
suggests that it is broken there as well.

Is the fix as simple as this?

--- ExprNodes.py~   2014-01-16 12:31:08.377573000 -0500
+++ ExprNodes.py2014-01-16 12:30:56.945501000 -0500
@@ -1605,7 +1605,7 @@ class NameNode(AtomicExprNode):

 if self.type.is_const:
 error(self.pos, "Assignment to const '%s'" % self.name)
-if self.type.is_reference:
+if self.type.is_reference and not self.entry.is_arg:
 error(self.pos, "Assignment to reference '%s'" % self.name)
 if not self.is_lvalue():
 error(self.pos, "Assignment to non-lvalue '%s'"

This seems to work for me, but ...

I wonder if it is also correct to set self.entry.cf_unused = True
for the case of assignment to reference arguments, to avoid CYTHON_UNUSED
annotations in the function definitions and unused variable warnings.

--
Bob


___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.20 beta 2

2014-01-16 Thread Christoph Gohlke

On 1/13/2014 2:24 AM, Stefan Behnel wrote:

Hi Christoph,

thanks for testing!

Christoph Gohlke, 13.01.2014 09:46:

I have trouble running the tests (`runtests.py`) on Windows:
[...]
There are hundreds of test errors, most of kind `IOError: [Errno 24] Too
many open files`.


The tests start consistently failing at some point, which hints at a file
handle leak, either in the test runner or in the compiler.



The test output for 64 bit Python 2.7 with numpy 1.7.2 and msvc9 is at
.


Yes, lots of problems and warnings. Might take a bit to look through all of
them.

Regarding this one:

"""
compiling (cpp) and running final_method_T586 ... final_method_T586.c
final_method_T586.c(8) : fatal error C1083: Cannot open include file:
'pyconfig.h': No such file or directory
ERROR
"""

Is there no "pyconfig.h" amongst the CPython header files on Windows?

Stefan



According to Process Explorer 
, 
`\Device\ConDrv` (the Windows Console Driver) file handles are leaked 
during `Doctest`. When the number of open file handles reaches about 
2000, all kind of things start to fail, including the compiler not being 
able to open/find files such as 'pyconfig.h'. No file handles are leaked 
when testing Cython 0.19.2.


Christoph
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.20 beta 2

2014-01-16 Thread Robert Bradshaw
On Thu, Jan 16, 2014 at 6:21 PM, Christoph Gohlke  wrote:
> On 1/13/2014 2:24 AM, Stefan Behnel wrote:
>>
>> Hi Christoph,
>>
>> thanks for testing!
>>
>> Christoph Gohlke, 13.01.2014 09:46:
>>>
>>> I have trouble running the tests (`runtests.py`) on Windows:
>>> [...]
>>> There are hundreds of test errors, most of kind `IOError: [Errno 24] Too
>>> many open files`.
>>
>>
>> The tests start consistently failing at some point, which hints at a file
>> handle leak, either in the test runner or in the compiler.
>>
>>
>>> The test output for 64 bit Python 2.7 with numpy 1.7.2 and msvc9 is at
>>>
>>> .
>>
>>
>> Yes, lots of problems and warnings. Might take a bit to look through all
>> of
>> them.
>>
>> Regarding this one:
>>
>> """
>> compiling (cpp) and running final_method_T586 ... final_method_T586.c
>> final_method_T586.c(8) : fatal error C1083: Cannot open include file:
>> 'pyconfig.h': No such file or directory
>> ERROR
>> """
>>
>> Is there no "pyconfig.h" amongst the CPython header files on Windows?
>>
>> Stefan
>>
>
> According to Process Explorer
> ,
> `\Device\ConDrv` (the Windows Console Driver) file handles are leaked during
> `Doctest`. When the number of open file handles reaches about 2000, all kind
> of things start to fail, including the compiler not being able to open/find
> files such as 'pyconfig.h'. No file handles are leaked when testing Cython
> 0.19.2.

No file handles appear to be leaked running under OS X or Linux. Could
you perhaps do a binary search on the git repo to locate the
incriminating CL?
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.20 beta 2

2014-01-16 Thread Stefan Behnel
Christoph Gohlke, 17.01.2014 03:21:
> On 1/13/2014 2:24 AM, Stefan Behnel wrote:
>> Christoph Gohlke, 13.01.2014 09:46:
>>> I have trouble running the tests (`runtests.py`) on Windows:
>>> [...]
>>> There are hundreds of test errors, most of kind `IOError: [Errno 24] Too
>>> many open files`.
>>
>> The tests start consistently failing at some point, which hints at a file
>> handle leak, either in the test runner or in the compiler.
>>
>>> The test output for 64 bit Python 2.7 with numpy 1.7.2 and msvc9 is at
>>> .
>
> According to Process Explorer
> ,
> `\Device\ConDrv` (the Windows Console Driver) file handles are leaked
> during `Doctest`. When the number of open file handles reaches about 2000,
> all kind of things start to fail, including the compiler not being able to
> open/find files such as 'pyconfig.h'. No file handles are leaked when
> testing Cython 0.19.2.

That sounds like it's a problem in the test runner, maybe leaking
subprocesses. On unixish systems, it forks out for each test, but not on
Windows. That makes it likely that you wouldn't notice the problem under
Unix, because the ending child process would clean up the leak. On Windows,
it would add up instead as everything is run by the mainprocess. And since
there are more tests now than in Cython 0.19.x, also more "srctree" tests
that unfold whole directories and run multiple shell commands on them, it's
not impossible that we simply reached the maximum number of file handles
now and stayed a bit below before.

I pushed a couple of fixes to the master branch, but I don't think I found
the problem yet. If you say it's in the doctests, then we'll have to dig
over there a bit more.

Stefan

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel