GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-39593: Adding an unit test of ctypes by shihai1991 · Pull Request #18424 · python/cpython

Conversation

@shihai1991

@shihai1991 shihai1991 commented Feb 9, 2020 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

https://bugs.python.org/issue39593

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shihai1991
Adding an unit test of ctypes
7727b2d
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 9, 2020
@bedevere-bot bedevere-bot added the awaiting review label Feb 9, 2020
@shihai1991 shihai1991 mentioned this pull request Feb 9, 2020
bpo-39573: Use Py_SIZE() in s_set() of cfield.c #18419
Closed
@shihai1991
shihai1991 requested review from corona10 and vstinner February 9, 2020 16:26
@codecov

codecov Bot commented Feb 9, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #18424 into master will increase coverage by 0.99%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #18424       +/-   ##
===========================================
+ Coverage   82.19%   83.19%    +0.99%     
===========================================
  Files        1957     1570      -387     
  Lines      589306   414436   -174870     
  Branches    44428    44428               
===========================================
- Hits       484409   344788   -139621     
+ Misses      95235    59998    -35237     
+ Partials     9662     9650       -12     
Impacted Files Coverage Δ
Lib/distutils/tests/test_bdist_rpm.py 30.00% <0.00%> (-65.00%) ⬇️
Lib/distutils/command/bdist_rpm.py 7.63% <0.00%> (-56.88%) ⬇️
Lib/test/test_urllib2net.py 76.92% <0.00%> (-13.85%) ⬇️
Lib/test/test_smtpnet.py 78.57% <0.00%> (-12.86%) ⬇️
Lib/ftplib.py 63.85% <0.00%> (-6.06%) ⬇️
Lib/test/test_ftplib.py 87.11% <0.00%> (-4.72%) ⬇️
Lib/dbm/__init__.py 66.66% <0.00%> (-4.45%) ⬇️
Tools/scripts/db2pickle.py 17.82% <0.00%> (-3.97%) ⬇️
Lib/test/test_socket.py 71.94% <0.00%> (-3.87%) ⬇️
Tools/scripts/pickle2db.py 16.98% <0.00%> (-3.78%) ⬇️
... and 431 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f6f7ee...f013d98. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@corona10 corona10 added the skip news label Feb 10, 2020
corona10
corona10 reviewed Feb 10, 2020
View reviewed changes
Comment thread Modules/_ctypes/cfield.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991
Adding bpo info in code
f013d98
corona10
corona10 approved these changes Feb 10, 2020
View reviewed changes

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on my side.
@vstinner Can you please take a look?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Feb 10, 2020
@csabella
csabella requested review from vstinner and removed request for vstinner May 25, 2020 17:53
vstinner
vstinner reviewed May 27, 2020
View reviewed changes
Comment thread Lib/ctypes/test/test_struct_fields.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented May 27, 2020

Copy link
Copy Markdown
Member

Oops, I had a pending comment that I never submitted!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shihai1991 added 2 commits May 28, 2020 00:56
@shihai1991
Merge remote-tracking branch 'origin/master' into bpo_39593
ab1a72d
@shihai1991
update struct_fields' case
dfa4d1b
@shihai1991

shihai1991 commented May 27, 2020

Copy link
Copy Markdown
Member Author

Oops, I had a pending comment that I never submitted!

I always forget to submit too ; )

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991

shihai1991 commented May 27, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@vstinner Hi, victor. There have a testcase of nomralizeing() in #19069, can you take a look if you have free time, thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed May 28, 2020
View reviewed changes
Comment thread Modules/_ctypes/cfield.c Outdated

data = PyBytes_AS_STRING(value);
size = strlen(data); /* XXX Why not Py_SIZE(value)? */
/* bpo-39593: XXX Why not Py_SIZE(value)? */

@vstinner vstinner May 28, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that it's correct to add a test which indirectly specify the behavior and keep this comment which suggests to change the behavior.

I suggest to rewrite the comment to explain that we do use strlen() on purpose, rather than PyBytes_GET_SIZE() since we truncate characters after a null character on purpose. Keep the bpo number in the comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@shihai1991 shihai1991 May 28, 2020

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, got it. I updated the description info, do you think it's clear enough?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shihai1991
update desc in s_set()
fd6c06c
vstinner
vstinner reviewed May 28, 2020
View reviewed changes
Comment thread Modules/_ctypes/cfield.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991 @vstinner
Update Modules/_ctypes/cfield.c
bc3b678
Co-authored-by: Victor Stinner <[email protected]>
@shihai1991
shihai1991 requested a review from vstinner June 1, 2020 16:32
@vstinner
vstinner merged commit a97011b into python:master Jun 1, 2020
@bedevere-bot bedevere-bot removed the awaiting core review label Jun 1, 2020
@vstinner

vstinner commented Jun 1, 2020

Copy link
Copy Markdown
Member

Thanks, merged.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shihai1991

shihai1991 commented Jun 1, 2020

Copy link
Copy Markdown
Member Author

Thanks, merged.

Thanks, victor.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@corona10 corona10 corona10 approved these changes
@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@shihai1991 @vstinner @corona10 @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.