Skip to content

Warn for bytes/str parsing methods#38

Merged
ltratt merged 4 commits intosoftdevteam:regression_fixfrom
nanjekyejoannah:string_track_update
Apr 9, 2024
Merged

Warn for bytes/str parsing methods#38
ltratt merged 4 commits intosoftdevteam:regression_fixfrom
nanjekyejoannah:string_track_update

Conversation

@nanjekyejoannah
Copy link
Collaborator

@nanjekyejoannah nanjekyejoannah commented Mar 19, 2024

More thinking got me to think maybe we dont need to separate the objects.
@ltratt you are right, "" in py2.x is very close to "" in py3.x: I concluded from this
querying the difference in methods at least by parsing:

Bytes diff (py2.x bytes && py3.xbytes)
array(['__getslice__', '_formatter_field_name_split', '_formatter_parser',
   	'encode', 'format'], dtype='<U27')

Str diff (py2.x str && py3.xstr)

>>> main_list1
array(['__getslice__', '_formatter_field_name_split', '_formatter_parser',
   	'decode'], dtype='<U27')

When I get to runtime warning we can do with the states for the most part without separation.

This PR replaces the former and will do the warnings in several PRs instead of one huge one.

@ltratt
Copy link
Member

ltratt commented Mar 20, 2024

Looks like a good start to me!

@ltratt ltratt added this pull request to the merge queue Mar 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 20, 2024
@ltratt
Copy link
Member

ltratt commented Mar 20, 2024

12:20:53 test test_sys failed -- Traceback (most recent call last):
12:20:53   File "/ci/Lib/test/test_sys.py", line 741, in test_objecttypes
12:20:53     check('', calcsize(vh + 'lic'))
12:20:53   File "/ci/Lib/test/support/__init__.py", line 1292, in check_sizeof
12:20:53     test.assertEqual(result, size, msg)
12:20:53 AssertionError: wrong size for <type 'str'>: got 49, expected 37

That looks like a test that checks the size of a struct? Seems a bit odd to me, so we could consider disabling it?

@ltratt ltratt self-assigned this Mar 21, 2024
@ltratt ltratt added this pull request to the merge queue Apr 9, 2024
Merged via the queue into softdevteam:regression_fix with commit b03f43c Apr 9, 2024
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.

2 participants