Skip to content

allow the first call to wcsxfrm to return ERANGE #536

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

Merged
merged 1 commit into from
Mar 8, 2017

Conversation

benjaminp
Copy link
Contributor

If the output buffer provided to wcsxfrm is too small, errno is set to ERANGE. We should not error out in that case.

This corrects be487a6 on Windows, which is currently failing:

======================================================================
ERROR: test_strxfrm (test.test_locale.TestEnUSCollation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_locale.py", line 344, in test_strxfrm
    self.assertLess(locale.strxfrm('a'), locale.strxfrm('b'))
OSError: [Errno 34] Result too large
======================================================================
ERROR: test_strxfrm_with_diacritic (test.test_locale.TestEnUSCollation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_locale.py", line 365, in test_strxfrm_with_diacritic
    self.assertLess(locale.strxfrm('�'), locale.strxfrm('b'))
OSError: [Errno 34] Result too large
----------------------------------------------------------------------

@benjaminp benjaminp closed this Mar 7, 2017
@benjaminp benjaminp force-pushed the benjamin-wcsxfrm-error branch from 769d777 to 8886d5f Compare March 7, 2017 07:02
@benjaminp benjaminp reopened this Mar 7, 2017
@serhiy-storchaka
Copy link
Member

Seems wcsxfrm() can return n2 > n but set errno to 0. In that case the buffer contains a garbage.

If the output buffer provided to wcsxfrm is too small, errno is set to ERANGE. We should not error out in that case.
@benjaminp benjaminp force-pushed the benjamin-wcsxfrm-error branch from 7f55635 to 274dcbc Compare March 8, 2017 06:00
@benjaminp benjaminp merged commit ad4a0cc into master Mar 8, 2017
@benjaminp benjaminp deleted the benjamin-wcsxfrm-error branch March 8, 2017 06:24
jaraco pushed a commit that referenced this pull request Dec 2, 2022
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.17.2 to 0.18.3.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Changelog](https://github.com/pytest-dev/pytest-asyncio/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest-asyncio@v0.17.2...v0.18.3)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mariatta Wijaya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants