python - Explain why "-" is not a "-" -
i writing automation script in python dealt sending commands through telnet session. reason couldn't work. after ton of frustrating debugging, found when translating command of:
"ulimit -s 1024" the - in command became weird in utf-8. had translate in bytes because sending using telnet (i know should use ssh, fine in case) , realized weird because when printed command in bytes be:
b"ulimit \x##\x##\x##s 1024" i don't remember exact numbers, fixed copying , pasting new "-" used 2 lines in function , worked fine.
i did copy , paste in part 2 lines up, typed ulimit -s part. using idle
anyone know happened?
anyone know happened?
i can see 2 possibilities here. 1 inadvertently copy-pasted line of code web page or other document - had been replaced emdash (it happens me quote signs , typographic quote signs), looks minus sign it's utf8 multibyte sequence.
the other somehow idle editor effected "spelling check" of microsoft word, replaces (among others) quote signs typographic quote signs, 3 consecutive dots ellipsis , minus signs emdashes. might have been triggered rare keystroke combination typed in error (for example trigger windows 7 screen magnifier while trying type in, think, { symbol - on keyboard shift altgr [).
Comments
Post a Comment