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 — gh-110050: Adjust the newline position in the TypeError message of the random.seed call. by yilei · Pull Request #110051 · python/cpython

Conversation

@yilei

@yilei yilei commented Sep 28, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Issue: The TypeError message from random.seed call has a seemingly unintentional newline in the middle #110050

Sorry, something went wrong.

Uh oh!

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

All reactions
@yilei
Fix python#110050: Use a space instead of newline in the TypeError me…
1425320
…ssage of the random.seed call.
@yilei
yilei requested a review from rhettinger as a code owner September 28, 2023 20:18
@bedevere-app bedevere-app Bot added the awaiting review label Sep 28, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Sep 28, 2023
The TypeError message from random.seed call has a seemingly unintentional newline in the middle #110050
Closed
@sobolevn sobolevn added the skip news label Sep 28, 2023
@rhettinger

rhettinger commented Sep 29, 2023

Copy link
Copy Markdown
Contributor

The newline was intentional. Without it, the error line is 90 characters which is too long:

>>> len('TypeError: The only supported seed types are: None, int, float, str, bytes, and bytearray.')
90

That said, it might be nice to move the newline to just before the None giving a more natural line break.

All reactions

Sorry, something went wrong.

Uh oh!

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

@yilei
Keep the newline.
f88c21b
@yilei

yilei commented Sep 29, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

Ah OK, this is a strange convention to me, since in many cases you can't control the length of the message when it also includes strings formatted from other variables. Also, the file names in the trackeback are usually already much longer.

That said, I updated this PR to just adjust the newline position.

Thanks for the review!

All reactions

Sorry, something went wrong.

Uh oh!

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

@yilei yilei changed the title gh-110050: Use a space instead of newline in the TypeError message of the random.seed call. gh-110050: Adjust the newline position in the TypeError message of the random.seed call. Sep 29, 2023
@rhettinger
Merge branch 'main' into random
2e0e172
rhettinger
rhettinger approved these changes Sep 29, 2023
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Sep 29, 2023
@rhettinger rhettinger added the needs backport to 3.12 only security fixes label Oct 2, 2023
@rhettinger
Merge branch 'main' into random
ac3407a
@ambv
ambv merged commit ce43d5f into python:main Oct 10, 2023
@miss-islington

miss-islington commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

Thanks @yilei for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 10, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 10, 2023
@yilei @rhettinger @miss-islington
pythongh-110050: Adjust the newline position in the TypeError message…
3f21697
… of the random.seed call. (pythonGH-110051)

(cherry picked from commit ce43d5f)

Co-authored-by: Yilei Yang <[email protected]>
Co-authored-by: Raymond Hettinger <[email protected]>
@bedevere-app

bedevere-app Bot commented Oct 10, 2023

Copy link
Copy Markdown

GH-110625 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 10, 2023
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@yilei @rhettinger @Glyphack
pythongh-110050: Adjust the newline position in the TypeError message…
cdb0c18
… of the random.seed call. (python#110051)

Co-authored-by: Raymond Hettinger <[email protected]>
@yilei
yilei deleted the random branch March 12, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rhettinger rhettinger rhettinger approved these changes

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

@yilei @rhettinger @miss-islington @ambv @sobolevn
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.