Skip to content

gh-119535: Support 𝜋thon in Python 3.14 venvs - #125035

Merged
hugovk merged 1 commit into
python:mainfrom
foreignmeloman:main
Oct 15, 2024
Merged

hugovk merged 1 commit into
python:mainfrom
foreignmeloman:main

Conversation

@foreignmeloman

@foreignmeloman foreignmeloman commented Oct 7, 2024 •

Copy link
Copy Markdown
Contributor

@foreignmeloman
foreignmeloman requested a review from vsajip as a code owner October 7, 2024 09:15
@ghost

ghost commented Oct 7, 2024 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app

bedevere-app Bot commented Oct 7, 2024

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@skirpichev

Copy link
Copy Markdown
Member

I would guess, it's already too late;) And sounds wrongly: "Pi", not "Py".

@hugovk

hugovk commented Oct 7, 2024

Copy link
Copy Markdown
Member

It's not too late.

In English, the py of python and pi are pronounced the same: /paɪ/ in IPA.

@thatbirdguythatuknownot

Copy link
Copy Markdown
Contributor

Also doesn't reveal the easter egg to terminal autocomplete (as far as i know autocomplete goes)

@foreignmeloman

Copy link
Copy Markdown
Contributor Author

Also doesn't reveal the easter egg to terminal autocomplete (as far as i know autocomplete goes)

Was it intended to show during the tab completion?

Comment thread Lib/venv/__init__.py
suffixes = ['python', 'python3', f'python3.{sys.version_info[1]}']
if sys.version_info[:2] == (3, 14):
suffixes.append('python𝜋')
suffixes.append('𝜋thon')

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.

Why can't we have both of them? 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we should decide on one option. An easter egg should be unique, otherwise it'll loose its punch.

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.

(I suggest creating the concept of an easter omlet)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Both would be better. 𝜋thon is the best of course, but python𝜋 is discoverable via tab-completion.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

An easter egg should be also hidden

Both would be better. 𝜋thon is the best of course, but python𝜋 is discoverable via tab-completion.

@hauntsaninja hauntsaninja left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hugo asked me if I have an opinion on this. I don't have a strong opinion, but for whatever it's worth I chose python𝜋 in the original PR because:

  • I think it's much easier to use, since your tab completion is narrowed to like four options. Especially so after the switch from U+03c0 to U+1d70b (I can type U+03c0 on my keyboard pretty easily but not U+1d70b)
  • Subjective, but to me some of the joke comes from the substitution of 3.14 in the "python3.14" file that venv creates. It's clearer that it's specific to this specific version of Python

@hugovk

hugovk commented Oct 15, 2024

Copy link
Copy Markdown
Member

Okay, let's go for this one :)

Remember, everyone: shhh!

@hugovk hugovk changed the title gh-119535: 𝜋thon looks and sounds way cooler gh-119535: Support 𝜋thon in Python 3.14 venvs Oct 15, 2024
@hugovk
hugovk merged commit fcef3fc into python:main Oct 15, 2024
hugovk added a commit to hugovk/cpython that referenced this pull request May 15, 2025
hauntsaninja pushed a commit that referenced this pull request May 15, 2025
* Revert "gh-119535: Support 𝜋thon in Python 3.14 venvs (#125035)"

This reverts commit fcef3fc.

* Revert "gh-119535: python𝜋 (#119536)"

This reverts commit 3fc673e.
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
* Revert "pythongh-119535: Support 𝜋thon in Python 3.14 venvs (python#125035)"

This reverts commit fcef3fc.

* Revert "pythongh-119535: python𝜋 (python#119536)"

This reverts commit 3fc673e.
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
* Revert "pythongh-119535: Support 𝜋thon in Python 3.14 venvs (python#125035)"

This reverts commit fcef3fc.

* Revert "pythongh-119535: python𝜋 (python#119536)"

This reverts commit 3fc673e.
@secolive

Copy link
Copy Markdown

I'm having oooh such a blast with this easter egg :
[sender] cannot convert filename: libexec/bin/𝜋thon (Illegal byte sequence)

@pczachor1

pczachor1 commented Dec 2, 2026 •

Copy link
Copy Markdown

For posterity – why couldn't we just use the normal 2-byte-encoded pi? The current one (in italics) requires 4 bytes. Learned it the hard way when users could create 3.14 venvs, but couldn't delete them ("directory not empty"). It appears that there are certain storage systems which typically (when you mount them via NFS4 and set the volume language to, *.utf-8 instead of explicitly asking for utf8mb4) allow for up to 3-byte characters in filenames... They can create such files and manipulate them if referenced directly, but they are unlistable.

@hugovk

hugovk commented Dec 2, 2026

Copy link
Copy Markdown
Member

Sounds like a bug in the storage system?

𝜋 (U+1D70B) is valid UTF-8, and it's a 4-byte character just like any emoji, so any file with an emoji in its name would likely hit the same problem there. A filesystem that can create a file but not list it is worth reporting upstream.

The symlink is only in 3.14 venvs and was removed in 3.15.

@pczachor1

pczachor1 commented Dec 2, 2026 •

Copy link
Copy Markdown

From what I've read, it's more like a weird feature (motivated by performance if I understand it correctly) than a bug, as it's well documented (but still not obvious if you're not looking for it). And yes – I agree that calling something "UTF-8" while it's not a full UTF-8 isn't the best practice by the devs of the storage system (although I think MySQL also makes similar distinction between subsets of the full UTF-8). My point is that there are always bound to be such exotic cases here and there and the potential of breaking such systems should be taken into consideration when planning a joke (a clever one, I won't argue!) .

Also, maybe I'm a bit old-fashioned, but using emojis and 4-byte characters in filenames seems a bit outlandish for me, and asking for trouble. Meanwhile, if the joke could be perfectly achieved by a more failure-proof, 2-byte character, why not use it instead? I know it's probably a bit too late to change this one and I'm not writing this to blame anyone, but – as noted – let's consider it the next time. :-)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.