[issue18340] float related test has problem with Denormal Flush to Zero compiler options

2013-07-01 Thread V.E.O

New submission from V.E.O:

With Intel Compiler's default options or GCC with -mfpmath=sse, the built 
Python failed at float related test.

For failures in test_strtod:
Traceback (most recent call last):
  File ".\test_strtod.py", line 190, in test_boundaries
self.check_strtod(s)
  File ".\test_strtod.py", line 104, in check_strtod
"expected {}, got {}".format(s, expected, got))
AssertionError: '0x0.fp-1022' != '0x0.0p+0'
- 0x0.fp-1022
+ 0x0.0p+0
 : Incorrectly rounded str->float conversion for 22250738585072008690e-327: 
expected 0x0.fp-1022, got 0x0.0p+0

22250738585072008690e-327 is less than positive normalize float 
2250738585072014e-308 in sys.float_info, that is denormal float

With SSE optimization opened on current compilers, Denormal Flush to Zero 
feature will flush all denormal float to 0 to avoid hardware unsupport and 
increase performance.

The tests here better be skipped on DFZ opened binaries.
http://bugs.python.org/issue1672332 is related to this problem.

Reference:
http://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/GUID-3A5C3E47-250D-4178-A0D4-6C4ACDDA5EB8.htm

--
components: Tests
messages: 192134
nosy: V.E.O, mark.dickinson
priority: normal
severity: normal
status: open
title: float related test has problem with Denormal Flush to Zero compiler 
options
type: behavior
versions: Python 3.3

___
Python tracker 
<http://bugs.python.org/issue18340>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18340] float related test has problem with Denormal Flush to Zero compiler options

2013-07-01 Thread V.E.O

V.E.O added the comment:

Hi Mark,

Sorry for unclear DFZ abbreviation, that is when compiler opened with FTZ and 
DAZ feature.
My operating system is Linux X64, I only tried Intel Compiler. In default 
optimization mode, the FTZ option is opened. Don't known why Intel make it the 
default option, maybe they think performance handling Subnormal number values 
and compatibility with some hardware.
https://en.wikipedia.org/wiki/Subnormal_number#Disabling_denormal_floats_at_the_code_level
 

The configure script of Python may not have precise detection on Intel 
Compiler, that feature can be closed with -no-ftz options.

Hi Christian,

I've not test GCC's DFZ/FTZ options, I'd like to test it myself and report here.
Maybe '-ffast-math' is the right option.

Hi Stefan,

Tried to change the mode, but not work, seems the right options is '-no-ftz'.

Regards,
V.E.O

--

___
Python tracker 
<http://bugs.python.org/issue18340>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18340] float related test has problem with Denormal Flush to Zero compiler options

2013-07-02 Thread V.E.O

V.E.O added the comment:

Hi All,

>From my test, GCC will not enforce DFZ/FTZ only by compiler options. It needs 
>code modify register flag.

I think it's a problem with Intel Compiler.
Maybe from platform.python_compiler(), these tests can identify the compiler 
and be skipped.
But the identification is ambiguous, for in Linux it's "GCC Intel(R) C++ gcc 
x.x mode", in Windows it's like "MSC v.1600 32 bit (Intel)"

If the support for Intel Compiler is not OK, we can pending these issues for 
future fix.

--

___
Python tracker 
<http://bugs.python.org/issue18340>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18340] float related test has problem with Denormal Flush to Zero compiler options

2013-07-02 Thread V.E.O

V.E.O added the comment:

Hi Mark,

If these flag is opened by code running in Python, DAZ FTZ flags should be 
opened.
With Intel Compiler, in default, they add code opening the flag for you.

--

___
Python tracker 
<http://bugs.python.org/issue18340>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-07-06 Thread V.E.O

V.E.O added the comment:

Tested on MSVCRT110.DLL (11.0.51106.1 released in 2012/11/05). 
Previous one 11.0.50727.1 released in 2012/07/26 does not have this problem.
This problem better be fixed in Python for MS does not have clear document.

--
nosy: +V.E.O

___
Python tracker 
<http://bugs.python.org/issue17797>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-07-07 Thread V.E.O

V.E.O added the comment:

Hi Christian,

The latest runtime Microsoft provided is buggy.
Tried fix the PyVerify_fd with more GetFileType verification. But a lot more 
problems came for isatty returns true in non-console program. The fix in Python 
side shall be large.
Details is reported to Microsoft, we can only hope they make it right.

--
status: pending -> open

___
Python tracker 
<http://bugs.python.org/issue17797>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15813] Python function decorator scope losing variable

2012-08-29 Thread V.E.O

New submission from V.E.O:

I just learned python @ decorator, it's cool, but soon I found my modified code 
coming out weird problems.

def with_wrapper(param1):
def dummy_wrapper(fn):
print param1
param1 = 'new'
fn(param1)
return dummy_wrapper

def dummy():
@with_wrapper('param1')
def implementation(param2):
print param2

dummy()



I debug it, it throws out exception at print param1

UnboundLocalError: local variable 'param1' referenced before assignment

If I remove param1 = 'new' this line, without any modify operation(link to new 
object) on variables from outer scope, this routine might working.

Is it meaning I only have made one copy of outer scope variables, then make 
modification?
The policy of variable scope towards decorator is different?

--
components: Interpreter Core
messages: 169389
nosy: V.E.O
priority: normal
severity: normal
status: open
title: Python function decorator scope losing variable
type: compile error
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue15813>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16183] ZipExtFile object close without file handle closed

2012-10-10 Thread V.E.O

New submission from V.E.O:

Hi, I tried to open file-like object ZipExtFile in one zip file, after 
operations, I close it and after all, close ZipFile.
But I still can not remove the zip file immediately.

This problem happens on Windows, error msg:
WindowsError: [Error 32] The process cannot access the file because it is being 
used by another process: ..

Sample code as below:

z = ZipFile('D:\\1', 'r')
zlist = z.infolist()
for zi in zlist:
zf = z.open(zi)
zf.close()

z.close()
os.remove(attach)

--
components: Library (Lib)
messages: 172555
nosy: V.E.O
priority: normal
severity: normal
status: open
title: ZipExtFile object close without file handle closed
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue16183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16183] ZipExtFile object close without file handle closed

2012-10-10 Thread V.E.O

Changes by V.E.O :


--
type:  -> behavior

___
Python tracker 
<http://bugs.python.org/issue16183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com