[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-06-23 Thread Steve Dower

Steve Dower added the comment:

Finally got back to looking at this, and since %f works against MSVC 14.0 I'm 
just going to remove the part of the test that is currently failing and close 
this issue.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-06-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2c10e9f62613 by Steve Dower in branch '3.5':
Closes #24244: Removes invalid test from test_time
https://hg.python.org/cpython/rev/2c10e9f62613

New changeset f0ca1fabb41f by Steve Dower in branch 'default':
Closes #24244: Removes invalid test from test_time
https://hg.python.org/cpython/rev/f0ca1fabb41f

--
resolution:  - fixed
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

But why was it building just fine before this commit? I haven't updated my 
system packages in a while.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Steve Dower

Steve Dower added the comment:

Those macros are only included if Py_BUILD_CORE is defined, regardless of 
platform (see Include/pyport.h).

Is it possible that's being undefined somehow?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Steve Dower

Steve Dower added the comment:

Looking at a `grep PY_CORE_CFLAGS`, that sounds reasonable to me.

I assumed that all core files were already being compiled with Py_BUILD_CORE 
(they certainly are for Windows), so this seems to be an oversight for 
timemodule.c.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Ned Deily

Ned Deily added the comment:

I think you have a Python installed in /usr/local that is interfering.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

 Wild guess: perhaps you did a ./configure or the Makefile did an implicit 
 call to configure recently and/or you did a make install (to /usr/local) 
 before?

I don't have 'python' in /usr/local and /usr/local/bin

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Ned Deily

Ned Deily added the comment:

But do you have any Python header files in /usr/local/include?  The gcc command 
you pasted shows -I/usr/local/include?  Mine don't show that.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

yury@ysmac ~/dev/py/cpython (HG: default?) $ ls /usr/local/include/
librtmp osxfuse pycairo

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

FWIW, I think that in order to use _Py_BEGIN_SUPPRESS_IPH timemodule.c should 
be compiled with PY_CORE_CFLAGS, and that should be reflected in the Makefile.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Ned Deily

Ned Deily added the comment:

Yury, I'm not seeing that compile error with current head of default on OS X. 
Try a clean build, perhaps?

--
nosy: +ned.deily

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

This exact sequence of commands

$ make clean
$ ./configure
$ make -j8

does not build.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

$ hg status
shows nothing, branch is default (but 3.5 doesn't get built either) etc.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Ned Deily

Ned Deily added the comment:

Wild guess: perhaps you did a ./configure or the Makefile did an implicit call 
to configure recently and/or you did a make install (to /usr/local) before?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

timemodule.c no longer compiles on MacOSX:


gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv 
-O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I./Include 
-I. -IInclude -I/usr/local/include -I/Users/yury/dev/py/cpython/Include 
-I/Users/yury/dev/py/cpython -c /Users/yury/dev/py/cpython/Modules/timemodule.c 
-o 
build/temp.macosx-10.10-x86_64-3.5/Users/yury/dev/py/cpython/Modules/timemodule.o
/Users/yury/dev/py/cpython/Modules/timemodule.c:656:9: error: use of undeclared 
identifier '_Py_BEGIN_SUPPRESS_IPH'
_Py_BEGIN_SUPPRESS_IPH
^
/Users/yury/dev/py/cpython/Modules/timemodule.c:658:9: error: use of undeclared 
identifier '_Py_END_SUPPRESS_IPH'
_Py_END_SUPPRESS_IPH
^
2 errors generated.

--
nosy: +yselivanov
priority: normal - critical

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Steve Dower

Steve Dower added the comment:

That change was in for beta 1, so we would have noticed if we didn't get Mac 
builds.

Something else has changed, probably some headers.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

 Towards the end of the configured top-level Makefile, you should see:

Yes, I don't see that line.  What should I do to regenerate it?  And another 
question: what did go wrong with my checkout?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Majeed Arni

Majeed Arni added the comment:

Though %f is a valid format from Python's doc 
https://docs.python.org/2/library/datetime.html, the fix just ignores it on 
Windows? can we atleast get milliseconds on Windows and Micro on Linux?

%f  Microsecond as a decimal number, zero-padded on the left.   00, 
01, ..., 99 (4)

%f is an extension to the set of format characters in the C standard (but 
implemented separately in datetime objects, and therefore always available). 
When used with the strptime() method, the %f directive accepts from one to six 
digits and zero pads on the right.

New in version 2.6.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Ned Deily

Ned Deily added the comment:

Yury, another (less) wild guess: do you have an out-of-date Modules/Setup or 
Setup.local?  timemodule is defined in Setup.dist but that will be overridden 
by a locally modified copy in the Modules directory.  Towards the end of the 
configured top-level Makefile, you should see:

# Rules appended by makedepend

[...]

Modules/timemodule.o: $(srcdir)/Modules/timemodule.c; $(CC) $(PY_CORE_CFLAGS)  
-c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread R. David Murray

R. David Murray added the comment:

Note that when I run into build problems after an update, I generally run 'make 
distclean' and then redo the configure/make.  This generally cleans up any 
problems like this (and I don't find that I need to do it very often.)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Ned Deily

Ned Deily added the comment:

So you did, sorry!  Another, perhaps evan more reliable option is (requires 
enabling the purge extension in hg):

hg purge --all

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Ned Deily

Ned Deily added the comment:

Check the times and contents on all of your Modules/Setup* files.  Try deleting 
Setup.local for one.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

 Check the times and contents on all of your Modules/Setup* files.  Try 
 deleting Setup.local for one.

I just made a clean checkout and that helped.  I have no idea what caused this. 
 Thank you, Ned, for troubleshooting this with me!

--
priority: critical - normal

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Ned Deily

Ned Deily added the comment:

 Note that when I run into build problems after an update, I generally
 run 'make distclean' and then redo the configure/make.

Yes, but I believe that won't help with changed Modules/Setup* files and, 
because it is needed in the core interpreter executable, timemodule.c is 
supposed to be built using Setup and not setup.py.  Setup and Setup.local are 
designed to be locally modified and thus not revision controlled nor cleaned by 
make clean:

$ cat Modules/Setup.dist
# The file Setup is used by the makesetup script to construct the files
# Makefile and config.c, from Makefile.pre and config.c.in,
# respectively.  The file Setup itself is initially copied from
# Setup.dist; once it exists it will not be overwritten, so you can edit
# Setup to your heart's content.  Note that Makefile.pre is created
# from Makefile.pre.in by the toplevel configure script.
[...]
$ hg stat --all Modules
I Modules/Setup
I Modules/Setup.config
I Modules/Setup.local

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Yury Selivanov

Yury Selivanov added the comment:

Steve, maybe you can surround _Py_BEGIN_SUPPRESS_IPH with #ifdef 
Py_BUILD_CORE?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread R. David Murray

R. David Murray added the comment:

Right, that's why I said make *dist*clean.  That does delete any existing Setup 
file(s), which is what you want when working with a checkout for Python 
development purposes.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-27 Thread Steve Dower

Steve Dower added the comment:

When do we build timemodule.c outside of core?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 254b8e68959e by Steve Dower in branch 'default':
Issue 24244: Prevents termination when an invalid format string is encountered 
on Windows.
https://hg.python.org/cpython/rev/254b8e68959e

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-22 Thread Steve Dower

Steve Dower added the comment:

That handles Python 3.5 and future versions, even if the supported formats 
change.

Is there something that needs fixing in 3.4? I don't get a crash, just the 
ValueError...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-20 Thread R. David Murray

R. David Murray added the comment:

So, this is expected behavior on Windows.  I'm inclined to close the issue as 
not a bug unless the Windows folks think eryksun suggestion is worth 
considering.  (If the error is suppressed, does windows fill in the rest of the 
values and just leave the %f in the string?)

--
components: +Windows
nosy: +steve.dower, tim.golden, zach.ware
title: Python Crash on strftime with %f on Python 3 and Python 2 - Python 
exception on strftime with %f on Python 3 and Python 2 on windows

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-20 Thread eryksun

eryksun added the comment:

 If the error is suppressed, does windows fill in the rest of 
 the values and just leave the %f in the string?

No, it does not. I understand now why ValueError was an intentional choice 
here. The CRT actually breaks the loop with a goto if any call to expand_time 
fails. So raising a Python exception is the only reasonable course of action. 
(I still think maybe it's a good place to use the new _Py_BEGIN_SUPPRESS_IPH 
macro. That way instead of presuming what's a valid format code, it could just 
handle the EINVAL.)

--
components:  -Windows
versions:  -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-20 Thread Steve Dower

Steve Dower added the comment:

_Py_*_SUPPRESS_IPH is the right thing to use here. It still displays an 
assertion dialog in debug builds, but ignoring it has the correct effect.

Patch attached for 3.5

--
keywords: +patch
Added file: http://bugs.python.org/file39438/24244_1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-20 Thread R. David Murray

R. David Murray added the comment:

OK.  What made me wonder is that I saw that the 'invalid format string' 
exception was removed by the patch...I guess that is also raised at a higher 
level in the code.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-20 Thread Steve Dower

Steve Dower added the comment:

It raises ValueError just like now (no visible change), but it won't crash and 
doesn't require being able to validate the complete format string.

If we want any different behaviour, we need to reimplement strftime for Python, 
which I'd be okay with, but I'm not the one to do it :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-20 Thread Steve Dower

Steve Dower added the comment:

It's raised by the existing handling for EINVAL at the end of the function. 
Previously we'd crash before getting that far because of the invalid parameter 
handler.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-20 Thread R. David Murray

R. David Murray added the comment:

What's the behavior after this patch?  Does it just return the string 
unmodified?  Or return a null string?  Or is the traceback generated at a 
higher level (and if so what is the error message?)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows

2015-05-20 Thread eryksun

Changes by eryksun eryk...@gmail.com:


--
components: +Windows

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24244
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com