[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread STINNER Victor
STINNER Victor added the comment: I removed the two offending macro defines from Python.h (pyerrors.h) in 3.9 and master branches. I close the issue. I also simplified PyOS_snprintf() and PyOS_vsnprintf() implementation in the master branch: they no longer call Py_FatalError() on buffer

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7ab92d54b5d4440d84f6c02b4bc5a70103eff915 by Victor Stinner in branch 'master': bpo-36020: Require vsnprintf() to build Python (GH-20899) https://github.com/python/cpython/commit/7ab92d54b5d4440d84f6c02b4bc5a70103eff915 --

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +20082 pull_request: https://github.com/python/cpython/pull/20899 ___ Python tracker ___

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread miss-islington
miss-islington added the comment: New changeset b498c7f1b3890e43ea2e7d1570f8403707ea4cc6 by Miss Islington (bot) in branch '3.9': bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889) https://github.com/python/cpython/commit/b498c7f1b3890e43ea2e7d1570f8403707ea4cc6 --

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread STINNER Victor
STINNER Victor added the comment: New changeset e822e37946f27c09953bb5733acf3b07c2db690f by Victor Stinner in branch 'master': bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889) https://github.com/python/cpython/commit/e822e37946f27c09953bb5733acf3b07c2db690f --

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +20080 pull_request: https://github.com/python/cpython/pull/20897 ___ Python tracker

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread Stefan Krah
Stefan Krah added the comment: I've tested the MSVC _snprintf extremely extensively in _decimal and never had a problem. -- ___ Python tracker ___

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread Stefan Krah
Stefan Krah added the comment: Can't we just use #ifndef __cplusplus instead of changing the function? I don't think anyone compiles the affected files with a C++ compiler. There are many areas in Include/* that fail with C++, e.g. isnan() with -std=c++11. -- nosy: +skrah

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread STINNER Victor
STINNER Victor added the comment: > On Python 3.8 and older, the workaround is to manually undefine the macros: > (...) pybind11 implemented a different workaround: --- /* Don't let Python.h #define (v)snprintf as macro because they are implemented properly in Visual Studio since 2015. */

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread STINNER Victor
STINNER Victor added the comment: In April, the issue was discussed on the capi-sig mailing list: https://mail.python.org/archives/list/capi-...@python.org/thread/5NXBZWKBMAPJJLNIXASSAYRIAP2OHJ53/ This issue was also mention in: https://github.com/jupyter-xeus/xeus-python/issues/283

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread STINNER Victor
STINNER Victor added the comment: I wrote PR 20889 which removes "snprintf" and "vsnprintf" macros from pyerrors.h. I propose to backport the change to 3.9, but leave 3.8 unchanged. On Python 3.8 and older, the workaround is to manually undefine the macros: --- #include // Undefine macros

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-06-15 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner nosy_count: 6.0 -> 7.0 pull_requests: +20072 pull_request: https://github.com/python/cpython/pull/20889 ___ Python tracker ___

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2020-01-13 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +17386 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17980 ___ Python tracker ___

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-03-24 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: I will continue to work on this issue when I will have a Windows virtual machine or a computer, for the moment I close my PR because it's not the right solution. Sorry for my inactivity about this issue. -- ___

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-20 Thread Steve Dower
Steve Dower added the comment: Start by just deleting the definitions in pyerrors.h, and see where the build fails. Then either switch those to use PyOS_snprintf (best), or add the #ifndef checks in the source files (not header files) that need them. Be aware that we shouldn't backport the

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-20 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hi @steve I'm not used to this, can you guide me? Thanks -- ___ Python tracker ___ ___

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-19 Thread Steve Dower
Steve Dower added the comment: We don't support older versions of MSVC at this point, so the version check seems unnecessary. If we need to alias these within the CPython sources for non-MSVC compilers, then we should do it in source files. In general, we never want to pollute the user's

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread palotasb-conti
palotasb-conti added the comment: For the record, I am basing the version check code on Boost also: https://www.boost.org/doc/libs/1_65_1/boost/convert/detail/config.hpp -- ___ Python tracker

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread palotasb-conti
palotasb-conti added the comment: I have the following internal, almost-minimal test case for this bug. It also relies on Boost Python, but that could be eliminated to produce a similar test case. # CMakeLists.txt cmake_minimum_required(VERSION 3.0) project(python-boost-mcve)

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread palotasb-conti
palotasb-conti added the comment: @matrixise: It works on my machine. ;) I would also add a check for `defined(_MSC_VER)` before `_MSC_VER < 1900` because the `MS_WIN32` does not seem to imply that the `_MSC_VER` macro is defined [1]. The correct check could be either #if

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hi, Do you suggest if this VM is correct for the tests? I will try to check with this one. https://developer.microsoft.com/en-us/windows/downloads/virtual-machines -- ___ Python tracker

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: For the version of MSVC, I have found this link: https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B -- ___ Python tracker ___

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @steve.dower, @zach.ware I don't have a Windows machine, I could install an official VM of Windows and install MSVC but I don't have time, I am working for my customer but I could check my PR later (I will wait for the feedback of AppVeyor). Thank you for

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- keywords: +patch pull_requests: +11939 stage: -> patch review ___ Python tracker ___ ___

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @palotasb-conti I don't have MSVC because on I work on Linux. Could tell me if this PR fixes your issue? Thank you -- nosy: +matrixise stage: patch review -> ___ Python tracker

[issue36020] HAVE_SNPRINTF and MSVC std::snprintf support

2019-02-18 Thread palotasb-conti
New submission from palotasb-conti : Abstract: pyerrors.h defines snprintf as a macro on MSVC even on versions of MSVC where this workaround causes bugs. snprintf is defined as _snprintf in pyerrors.h, see: