Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant
Activity
F18-Ray commentedon May 22, 2025
But the type of
sys.stdout
is actually_io.TextIOWrapper
if you don't give it any args, so it's nothing to do with python.serhiy-storchaka commentedon May 31, 2025
Just use
default=sys.stdout.buffer
in your code.argparse
does nothing with the default value. It just takes it as given. If you specifydefault=sys.stdout
, it sets the default tosys.stdout
. If you specifydefault=42
, it sets the default to42
. If this is not correct, the error is on your side.