Ticket #450 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Different float string representations on Windows

Reported by: robertwb Owned by: somebody
Priority: critical Milestone: 0.12
Component: Testing Keywords:
Cc:

Description

We'd have to somehow detect windows in tests/specialfloat.pyx and elsewhere

Running tests against Cython 0.12.alpha0
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

=== Expected errors: ===



=== Got errors: ===
2:21: Error in compile-time expression: ValueError: invalid literal  
for float():
nan
3:22: Error in compile-time expression: ValueError: invalid literal  
for float():
+inf
4:22: Error in compile-time expression: ValueError: invalid literal  
for float():
-inf

ERROR: compiling (c) and running specialfloat
ERROR: compiling (cpp) and running specialfloat
----------------------------------------------------------------------
Traceback (most recent call last):
File "runtests.py", line 398, in run
  self.runCompileTest()
File "runtests.py", line 271, in runCompileTest
  self.directory, self.expect_errors, self.annotate)
File "runtests.py", line 376, in compile
  self.assertEquals(None, unexpected_error)
AssertionError: None != u'2:21: Error in compile-time expression:  
ValueError: in
valid literal for float(): nan'

Also, for non-special floats

FAIL: Doctest: float_floor_division_T260.__test__.floor_div_float  
(line 1)
FAIL: Doctest: float_floor_division_T260.__test__.floor_div_float  
(line 1)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Programs\Python25\lib\doctest.py", line 2128, in runTest
  raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for  
float_floor_division_T260.__test__.floor
_div_float (line 1)
File "C:\Josef\work-oth\Cython-0.12.alpha0\BUILD\run\cpp 
\float_floor_division_
T260.pyd", line unknown line number, in floor_div_float (line 1)

----------------------------------------------------------------------
File "C:\Josef\work-oth\Cython-0.12.alpha0\BUILD\run\cpp 
\float_floor_division_T2
60.pyd", line ?, in  
float_floor_division_T260.__test__.floor_div_float (line 1)
Failed example:
  floor_div_float(1e10, 1e-10)
Expected:
  1e+20
Got:
  1e+020

Probably related:

 http://bugs.python.org/issue1635

Change History

Changed 4 years ago by robertwb

Changed 4 years ago by robertwb

  • status changed from new to closed
  • resolution set to fixed
  • component changed from Code Generation to Testing

Given that this behavior was considered a bug in Python (fixed in 2.6 and 3.0) and would be ugly and painful to adapt the tests just for Windows, I'm just going disable the test in that case.

Note: See TracTickets for help on using tickets.