Skip to content

allow the first call to wcsxfrm to return ERANGE#536

Merged
benjaminp merged 1 commit into
masterfrom
benjamin-wcsxfrm-error
Mar 8, 2017
Merged

allow the first call to wcsxfrm to return ERANGE#536
benjaminp merged 1 commit into
masterfrom
benjamin-wcsxfrm-error

Conversation

@benjaminp
Copy link
Copy Markdown
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
Copy Markdown
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] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
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