Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time.strftime("%Y"): limitation of 4 digits on OpenIndiana (Solaris) #55073

Closed
vstinner opened this issue Jan 8, 2011 · 7 comments
Closed

time.strftime("%Y"): limitation of 4 digits on OpenIndiana (Solaris) #55073

vstinner opened this issue Jan 8, 2011 · 7 comments
Labels
stdlib Python modules in the Lib dir

Comments

@vstinner
Copy link
Member

vstinner commented Jan 8, 2011

BPO 10864
Nosy @smontanaro, @vstinner

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2011-01-08.16:18:18.400>
created_at = <Date 2011-01-08.02:43:14.898>
labels = ['library']
title = 'time.strftime("%Y"): limitation of 4 digits on OpenIndiana (Solaris)'
updated_at = <Date 2011-03-21.01:12:17.126>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2011-03-21.01:12:17.126>
actor = 'python-dev'
assignee = 'none'
closed = True
closed_date = <Date 2011-01-08.16:18:18.400>
closer = 'vstinner'
components = ['Library (Lib)']
creation = <Date 2011-01-08.02:43:14.898>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 10864
keywords = []
message_count = 7.0
messages = ['125744', '125747', '125783', '125788', '125793', '125794', '131590']
nosy_count = 3.0
nosy_names = ['skip.montanaro', 'vstinner', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue10864'
versions = ['Python 3.2', 'Python 3.3']

@vstinner
Copy link
Member Author

vstinner commented Jan 8, 2011

The following example displays '2345' instead of '12345':

import time
t = (12345,) + (0,)*8
print(repr(time.strftime("%Y", t)))

time.strftime() should raise a ValueError if the year is bigger than 9999, as it is done with Visual Studio for year outside [1; 9999].

@vstinner vstinner added the stdlib Python modules in the Lib dir label Jan 8, 2011
@vstinner
Copy link
Member Author

vstinner commented Jan 8, 2011

Oh, it's more funny with negative numbers: -1 is formatted '000/'.

Let's try r87850. I'm now waiting for the buildbot.

@smontanaro
Copy link
Contributor

On my Mac it displays "12345". I don't see that as a big problem.
It raises ValueError for a year of -1. This is with build py3k:87566.

If someone wants to feed a year > 9999 to time.strftime I don't see that
as a big problem. I less sure about year < 0.

@vstinner
Copy link
Member Author

vstinner commented Jan 8, 2011

Let's try r87850. I'm now waiting for the buildbot.

The test pass on both OpenIndiana buildbots, so I close the issue.

On my Mac it displays "12345". I don't see that as a big problem.

Why do you say "problem"? It is the correct result :-)

@vstinner vstinner closed this as completed Jan 8, 2011
@smontanaro
Copy link
Contributor

Skip> On my Mac it displays "12345". I don't see that as a big problem.

haypo> Why do you say "problem"? It is the correct result :-)

I agree. I interpreted your ticket as complaining that it should raise
a ValueError if year > 9999:

> time.strftime() should raise a ValueError if the year is bigger
> than 9999, as it is done with Visual Studio for year
> outside [1; 9999].

@vstinner
Copy link
Member Author

vstinner commented Jan 8, 2011

Le samedi 08 janvier 2011 à 17:02 +0000, Skip Montanaro a écrit :

I agree. I interpreted your ticket as complaining that it should raise
a ValueError if year > 9999:

Only on OpenIndiana because on this specific OS, "%Y" only supoprts year
in [1; 9999]. For other values, it gives strange results :-)

@python-dev
Copy link
Mannequin

python-dev mannequin commented Mar 21, 2011

New changeset d56eb817b181 by Victor Stinner in branch '3.2':
Issue bpo-10864 has been fixed: remove the workaround
http://hg.python.org/cpython/rev/d56eb817b181

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

2 participants