Skip to content

bpo-29960 _random.Random state corrupted on exception.#953

Closed
bladebryan wants to merge 19 commits into
python:masterfrom
bladebryan:randrestore
Closed

bpo-29960 _random.Random state corrupted on exception.#953
bladebryan wants to merge 19 commits into
python:masterfrom
bladebryan:randrestore

Conversation

@bladebryan

Copy link
Copy Markdown
Contributor

Changes the _random.Random.setstate() function so that if it raises an exception the state of the generator is unchanged.

@the-knights-who-say-ni

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@mention-bot

Copy link
Copy Markdown

@bladebryan, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rhettinger, @serhiy-storchaka and @benjaminp to be potential reviewers.

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add an entry in Misc/NEWS.

Comment thread Modules/_randommodule.c Outdated
return NULL;
}
self->index = (int)index;
for (i=0; i<N; i++)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add spaces around operators = and <.

Comment thread Misc/NEWS Outdated
-----------------

- bpo-29960: Preserve generator state when _random.Random.setstate()
raises an exception.

@serhiy-storchaka serhiy-storchaka Apr 2, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add "Patch by $yourname." Use two spaces between sentences.

@rhettinger rhettinger self-assigned this Apr 2, 2017
@rhettinger

Copy link
Copy Markdown
Contributor

The 14 files changed seems wrong. I think a lot of other stuff may have inadvertently been included.

@bladebryan

Copy link
Copy Markdown
Contributor Author

I must have done something wrong in rebase. This pull request has gotten too messy, so I'll close it and create another.

@bladebryan bladebryan closed this Apr 7, 2017
@bladebryan
bladebryan deleted the randrestore branch April 7, 2017 06:25
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.

5 participants