Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-36779: time.tzname returns empty string on Windows if default cod…#13073

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
miss-islington merged 5 commits intopython:masterfrompaulmon:time_tzname
Jun 12, 2019

Conversation

@paulmon
Copy link
Contributor

@paulmonpaulmon commentedMay 3, 2019
edited by matrixise
Loading

Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].

This causes time.tzname to be an empty string.
I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.

In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7

@zooba

https://bugs.python.org/issue36779

@paulmon
Copy link
ContributorAuthor

paulmon commentedMay 22, 2019
edited
Loading

This workaround enables time.tzname to work on Windows ARM32.
Alternatively we could skip the test and leave time.tzname broken on Windows ARM32.
The CRT error which causes the empty string has been fixed in ucrtbase.dll but will likely take months to be published.

@matrixisematrixise changed the titlebpo-36799: time.tzname returns empty string on Windows if default cod…bpo-36779: time.tzname returns empty string on Windows if default cod…May 22, 2019
@matrixise
Copy link
Member

Hi@paulmon I have edited the PR because that was the wrong BPO issue. Also, I have added this PR to the right bpo issue and removed it from the other one.

@paulmon
Copy link
ContributorAuthor

Thank you!

@zooba
Copy link
Member

Definitely needs the tabs converted to spaces, and I wonder if there's a better (Windows-specific) way to get this value without changing the locale? If we're going to have an ifdef, we may as well use the proper APIs, provided the values come back the same (I have no idea what values to expect here).

@pganssle may also have an opinion. Or perhaps not :)

@paulmon
Copy link
ContributorAuthor

I'll try to get the timezone name without changing the locale.
And I'll fix the tabs of course.

@pganssle
Copy link
Member

Regardless of the resolution, I think this needs a test.

What is this supposed to return on Windows? What does it return with the workaround?

I think you can definitely get the time zone and alt zone names without changing the locale. One way to get it is from the registry, which is how we do itintzwinlocal. I think this returns things like "Eastern Standard Time" and "Eastern Daylight Time" rather than "EST"/"EDT".

There may be a more convenient way as well.

@paulmon
Copy link
ContributorAuthor

paulmon commentedMay 23, 2019
edited
Loading

This is the fix for a failing test. It's supposed to return 'UTC-08:00' and it returns an empty string.

FAIL: test_strptime (test.datetimetester.TestSubclassDateTime_Fast)

Traceback (most recent call last):
File "C:\python\lib\test\datetimetester.py", line 2523, in test_strptime
self.assertEqual(dt.tzname(), tzname)
AssertionError: 'UTC-08:00' != ''

@pganssle
Copy link
Member

Traceback (most recent call last):
File "C:\python\lib\test\datetimetester.py", line 2523, in test_strptime
self.assertEqual(dt.tzname(), tzname)
AssertionError: 'UTC-08:00' != ''

This is very confusing to me.This is the relevant test, and it seems like what it's doing is creating three strings:"+0000 UTC","-0000 GMT" and a locale-specific one. Iftime.tzname returns an empty string, I would expectthis line to raise an Exception, since the locale-specific string would be something like"-0800 ", which doesn't match%z %Z.

You can see what it's testing by running this script:

importtimefromdatetimeimportdatetimefortzseconds,tznamein ((0,'UTC'), (0,'GMT'),                         (-time.timezone,time.tzname[0])):print("-----")print(f"tzseconds:{tzseconds}; tzname:{tzname}")iftzseconds<0:sign='-'seconds=-tzsecondselse:sign='+'seconds=tzsecondshours,minutes=divmod(seconds//60,60)dtstr="{}{:02d}{:02d} {}".format(sign,hours,minutes,tzname)print(dtstr)

On my system, this returns:

-----tzseconds: 0; tzname: UTC+0000 UTC-----tzseconds: 0; tzname: GMT+0000 GMT-----tzseconds: -18000; tzname: EST-0500 EST

I am not sure whereUTC-0800 is coming from. Can you run my script on your system so we can see what's going on?

@paulmon
Copy link
ContributorAuthor

paulmon commentedMay 23, 2019
edited
Loading

On Windows IoT Core

-----tzseconds: 0; tzname: UTC+0000 UTC-----tzseconds: 0; tzname: GMT+0000 GMT-----tzseconds: -28800; tzname:-0800

on my dev machine (Windows 10 Enterprise)

-----tzseconds: 0; tzname: UTC+0000 UTC-----tzseconds: 0; tzname: GMT+0000 GMT-----tzseconds: -28800; tzname: Pacific Standard Time-0800 Pacific Standard Time

@paulmon
Copy link
ContributorAuthor

paulmon commentedMay 23, 2019
edited
Loading

UTC-0800 is my local time zone

import timetime.tzname

This returns('Pacific Standard Time', 'Pacific Daylight Time') on desktop windows
On Windows IoT Core it returns('', '')

I tracked this this down to a bug in tzset() that sets _tzname[0] and _tzname[1] to empty strings when the default ANSI code page is set to CP_UTF8, or CP_UTF7. For more on the default ANSI code page see , seeGetACP( )

The default ANSI code page on most Windows installs is not CP_UTF7, or CP_UTF8. On my dev machine for example it is 1252 (Code Page Identifiers).

On Windows IoT Core the default ANSI code page is 65001 or CP_UTF8.

So in line 2511 of datetimetester.py _time.tzname[0] is empty causing the test to fail.

        for tzseconds, tzname in ((0, 'UTC'), (0, 'GMT'),                                 (-_time.timezone, _time.tzname[0])):

Another way to check what the default ANSI codepage on your system is to run this command

reg query hklm\system\currentcontrolset\control\nls\codepage /v ACP`

@paulmon
Copy link
ContributorAuthor

I would expectthis line to raise an Exception

I think it doesn't raise an exception because it's valid to use "" as parameter to a format string.

@pganssle
Copy link
Member

This returns('Pacific Standard Time', 'Pacific Daylight Time') on desktop windows
On Windows IoT Core it returns('', '')

This is what I expected, but I don't understand why the test was working in the first place, on Linux:

>>>datetime.strptime("-0800 ",'%z %Z')...ValueError:timedata'-0800 'doesnotmatchformat'%z %Z'>>>datetime.strptime("-0800 Pacific Standard Time","%z %Z")...ValueError:timedata'-0800 Pacific Standard Time'doesnotmatchformat'%z %Z'

Is allowing empty format specifiers a Windows-specific thing?

@paulmon If the two commands above don't fail for you, what do they return? What is.tzname() on the datetimes they return?

@paulmonpaulmon reopened thisMay 23, 2019
@paulmon
Copy link
ContributorAuthor

Closing and re-opening to force azure pipelines to run again.
Not sure why it failed. It looked like the MacOS tests were cancelled for some reason.

@paulmon
Copy link
ContributorAuthor

paulmon commentedMay 24, 2019
edited
Loading

If the two commands above don't fail for you, what do they return? What is.tzname() on the datetimes they return?

There seems to be a connection between the value of time.tzname and the results of those two commands.

Without the current GetTimeZoneInformation fix

>>> time.tzname('', '')>>> datetime.strptime("-0800 ", "%z %Z")datetime.datetime(1900, 1, 1, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=57600)))>>> datetime.strptime("-0800 ", "%z %Z").tzname()'UTC-08:00'>>> datetime.strptime("-0800 Pacific Standard Time", "%z %Z")...ValueError: unconverted data remains: Pacific Standard Time

With the GetTimeZoneInformation fix

>>> time.tzname('Pacific Standard Time', 'Pacific Daylight Time')>>> datetime.strptime("-0800 ", "%z %Z")...ValueError: time data '-0800 ' does not match format '%z %Z'>>> datetime.strptime("-0800 Pacific Standard Time", "%z %Z")datetime.datetime(1900, 1, 1, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=57600), 'Pacific Standard Time'))>>> datetime.strptime("-0800 Pacific Standard Time", "%z %Z").tzname()'Pacific Standard Time'

@paulmon
Copy link
ContributorAuthor

The PR has been updated so that it doesn't change locale.
Does it look good, or do you think it needs more changes?
Thanks!

@zooba@pganssle

@zooba
Copy link
Member

@paulmon I think this one deserves a NEWS item - could you add it?

@miss-islington
Copy link
Contributor

@paulmon: Status check is done, and it's a success ✅ .

@miss-islingtonmiss-islington merged commitb4c7def intopython:masterJun 12, 2019
@miss-islington
Copy link
Contributor

Thanks@paulmon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-14032 is a backport of this pull request to the3.8 branch.

vstinner pushed a commit that referenced this pull requestJun 13, 2019
GH-13073) (GH-14032)Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].This causes time.tzname to be an empty string.I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7@zoobahttps://bugs.python.org/issue36779(cherry picked from commitb4c7def)Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
@miss-islington
Copy link
Contributor

Thanks@paulmon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 13, 2019
pythonGH-13073)Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].This causes time.tzname to be an empty string.I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7@zoobahttps://bugs.python.org/issue36779(cherry picked from commitb4c7def)Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
@bedevere-bot
Copy link

GH-14057 is a backport of this pull request to the3.7 branch.

miss-islington added a commit that referenced this pull requestJun 13, 2019
GH-13073)Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].This causes time.tzname to be an empty string.I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7@zoobahttps://bugs.python.org/issue36779(cherry picked from commitb4c7def)Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
@pganssle
Copy link
Member

pganssle commentedJun 16, 2019
edited
Loading

@paulmon Hey sorry I never followed up on this - this is belated, but for the record I agree with this change. Thank you for for doing this - particularly because I learned something new about howstrptime works (I didn't realize that it checkstzname if available, though it makes a lot of sense).

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 Debian root 3.8 has failed when building commit0a9baec.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/211/builds/47) and take a look at the build logs.
  4. Check if the failure is related to this commit (0a9baec) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/211/builds/47

Click to see traceback logs
Reset branch '3.8'libpython3.8d.a(bytesobject.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(exceptions.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(floatobject.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: more undefined references to `_PyTraceMalloc_NewReference' followlibpython3.8d.a(object.o):In function `_PyObject_AssertFailed':/root/buildarea/3.8.angelico-debian-amd64/build/Objects/object.c:2190: undefined reference to `_PyMem_DumpTraceback'libpython3.8d.a(object.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(obmalloc.o):In function `_PyObject_DebugDumpAddress':/root/buildarea/3.8.angelico-debian-amd64/build/Objects/obmalloc.c:2507: undefined reference to `_PyMem_DumpTraceback'libpython3.8d.a(sliceobject.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(tupleobject.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(typeobject.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(unicodeobject.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: more undefined references to `_PyTraceMalloc_NewReference' followlibpython3.8d.a(import.o):In function `find_frozen':/root/buildarea/3.8.angelico-debian-amd64/build/Python/import.c:1268: undefined reference to `PyImport_FrozenModules'libpython3.8d.a(marshal.o):In function `w_init_refs':/root/buildarea/3.8.angelico-debian-amd64/build/Python/marshal.c:572: undefined reference to `_Py_hashtable_compare_direct'/root/buildarea/3.8.angelico-debian-amd64/build/Python/marshal.c:572: undefined reference to `_Py_hashtable_hash_ptr'/root/buildarea/3.8.angelico-debian-amd64/build/Python/marshal.c:572: undefined reference to `_Py_hashtable_new'libpython3.8d.a(marshal.o):In function `w_clear_refs':/root/buildarea/3.8.angelico-debian-amd64/build/Python/marshal.c:598: undefined reference to `_Py_hashtable_foreach'/root/buildarea/3.8.angelico-debian-amd64/build/Python/marshal.c:599: undefined reference to `_Py_hashtable_destroy'libpython3.8d.a(marshal.o):In function `w_ref':/root/buildarea/3.8.angelico-debian-amd64/build/Python/marshal.c:308: undefined reference to `_Py_hashtable_get_entry'/root/buildarea/3.8.angelico-debian-amd64/build/Python/marshal.c:326: undefined reference to `_Py_hashtable_set'libpython3.8d.a(pylifecycle.o):In function `fatal_error':/root/buildarea/3.8.angelico-debian-amd64/build/Python/pylifecycle.c:2123: undefined reference to `_PyFaulthandler_Fini'libpython3.8d.a(pylifecycle.o):In function `Py_FinalizeEx':/root/buildarea/3.8.angelico-debian-amd64/build/Python/pylifecycle.c:1257: undefined reference to `_PyTraceMalloc_Fini'/root/buildarea/3.8.angelico-debian-amd64/build/Python/pylifecycle.c:1266: undefined reference to `_PyFaulthandler_Fini'libpython3.8d.a(pylifecycle.o):In function `pyinit_main':/root/buildarea/3.8.angelico-debian-amd64/build/Python/pylifecycle.c:932: undefined reference to `_PyFaulthandler_Init'/root/buildarea/3.8.angelico-debian-amd64/build/Python/pylifecycle.c:949: undefined reference to `_PyTraceMalloc_Init'libpython3.8d.a(config.o):(.data+0x128): undefined reference to `PyInit_faulthandler'libpython3.8d.a(config.o):(.data+0x138): undefined reference to `PyInit__tracemalloc'libpython3.8d.a(config.o):(.data+0x148): undefined reference to `PyInit__symtable'libpython3.8d.a(config.o):(.data+0x158): undefined reference to `PyInit_xxsubtype'libpython3.8d.a(gcmodule.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(_iomodule.o):In function `_io_open_impl':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:386: undefined reference to `PyFileIO_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:452: undefined reference to `PyBufferedRandom_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:454: undefined reference to `PyBufferedWriter_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:456: undefined reference to `PyBufferedReader_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:478: undefined reference to `PyTextIOWrapper_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:713: undefined reference to `PyBufferedIOBase_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyBufferedIOBase_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:713: undefined reference to `PyBufferedIOBase_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedIOBase_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyBufferedIOBase_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:714: undefined reference to `PyTextIOBase_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyTextIOBase_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:714: undefined reference to `PyTextIOBase_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyTextIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyTextIOBase_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyTextIOBase_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:718: undefined reference to `PyFileIO_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:719: undefined reference to `PyFileIO_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyFileIO_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:719: undefined reference to `PyFileIO_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyFileIO_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: more undefined references to `PyFileIO_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:722: undefined reference to `PyBytesIO_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:722: undefined reference to `PyBufferedIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:723: undefined reference to `PyBytesIO_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyBytesIO_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:723: undefined reference to `PyBytesIO_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBytesIO_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBytesIO_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyBytesIO_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:724: undefined reference to `_PyBytesIOBuffer_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:728: undefined reference to `PyStringIO_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:728: undefined reference to `PyTextIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:729: undefined reference to `PyStringIO_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyStringIO_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:729: undefined reference to `PyStringIO_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyStringIO_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyStringIO_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyStringIO_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:738: undefined reference to `PyBufferedReader_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:738: undefined reference to `PyBufferedIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:739: undefined reference to `PyBufferedReader_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyBufferedReader_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:739: undefined reference to `PyBufferedReader_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedReader_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedReader_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyBufferedReader_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:742: undefined reference to `PyBufferedWriter_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:742: undefined reference to `PyBufferedIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:743: undefined reference to `PyBufferedWriter_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyBufferedWriter_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:743: undefined reference to `PyBufferedWriter_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedWriter_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedWriter_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyBufferedWriter_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:746: undefined reference to `PyBufferedRWPair_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:746: undefined reference to `PyBufferedIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:747: undefined reference to `PyBufferedRWPair_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyBufferedRWPair_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:747: undefined reference to `PyBufferedRWPair_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedRWPair_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedRWPair_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyBufferedRWPair_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:750: undefined reference to `PyBufferedRandom_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:750: undefined reference to `PyBufferedIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:751: undefined reference to `PyBufferedRandom_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyBufferedRandom_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:751: undefined reference to `PyBufferedRandom_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedRandom_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyBufferedRandom_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyBufferedRandom_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:754: undefined reference to `PyTextIOWrapper_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:754: undefined reference to `PyTextIOBase_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:755: undefined reference to `PyTextIOWrapper_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyTextIOWrapper_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:755: undefined reference to `PyTextIOWrapper_Type'libpython3.8d.a(_iomodule.o):In function `_Py_DECREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyTextIOWrapper_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:470: undefined reference to `PyTextIOWrapper_Type'libpython3.8d.a(_iomodule.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:473: more undefined references to `PyTextIOWrapper_Type' followlibpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:758: undefined reference to `PyIncrementalNewlineDecoder_Type'libpython3.8d.a(_iomodule.o):In function `_Py_INCREF':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:459: undefined reference to `PyIncrementalNewlineDecoder_Type'libpython3.8d.a(_iomodule.o):In function `PyInit__io':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:758: undefined reference to `PyIncrementalNewlineDecoder_Type'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/_iomodule.c:758: undefined reference to `PyIncrementalNewlineDecoder_Type'libpython3.8d.a(iobase.o):In function `_io__RawIOBase_readall_impl':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/iobase.c:975: undefined reference to `_PyIO_trap_eintr'libpython3.8d.a(iobase.o):In function `_io__IOBase_writelines':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/iobase.c:788: undefined reference to `_PyIO_trap_eintr'libpython3.8d.a(iobase.o):In function `_io__IOBase_readline_impl':/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/iobase.c:564: undefined reference to `_PyIO_trap_eintr'/root/buildarea/3.8.angelico-debian-amd64/build/./Modules/_io/iobase.c:604: undefined reference to `_PyIO_trap_eintr'libpython3.8d.a(classobject.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(complexobject.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(genobject.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(context.o):In function `_Py_NewReference':/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: undefined reference to `_PyTraceMalloc_NewReference'libpython3.8d.a(context.o):/root/buildarea/3.8.angelico-debian-amd64/build/./Include/object.h:439: more undefined references to `_PyTraceMalloc_NewReference' followcollect2:error: ld returned 1 exit statusmake:*** [python] Error 1

@vstinner
Copy link
Member

@paulmon
Copy link
ContributorAuthor

paulmon commentedJun 17, 2019
edited
Loading

https://buildbot.python.org/all/#builders/211/builds/47

I reported this bug as:https://bugs.python.org/issue37314

It looks like a different commit caused this buildbot failure. The only file changed in this commit is timemodule.c, and the build failures are all in _iomodule.c

@vstinner
Copy link
Member

Welcome to the exciting universe of buildbots!

@paulmonpaulmon deleted the time_tzname branchJune 19, 2019 21:29
lisroach pushed a commit to lisroach/cpython that referenced this pull requestSep 10, 2019
pythonGH-13073)Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].This causes time.tzname to be an empty string.I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7@zoobahttps://bugs.python.org/issue36779
DinoV pushed a commit to DinoV/cpython that referenced this pull requestJan 14, 2020
pythonGH-13073)Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].This causes time.tzname to be an empty string.I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7@zoobahttps://bugs.python.org/issue36779
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@zoobazoobazooba approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@paulmon@matrixise@zooba@pganssle@miss-islington@bedevere-bot@vstinner@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp