horeah / PyCmd

Improved interactive experience for Windows' cmd.exe
GNU Lesser General Public License v3.0
18 stars 4 forks source link

Fixes crash on exceptions during internal CD github issue #2 #3

Closed santagada closed 1 year ago

santagada commented 1 year ago

Encoding is the function that turns strings into bytes

horeah commented 1 year ago

I have already stumbled into this myself, and I came up with a somewhat similar fix on my local master -- but I had not pushed it (collaborating with other developers on PyCmd happens rarely enough for me to become careless, sorry).

The question is: is there a need to encode anything? My local fix simply removes the call to decode() altogether -- am I missing something?

santagada commented 1 year ago

You don't need the u prefix in strings anymore on python 3. Also no need to encode if the stdout is open in text mode And finally there's FileNotFound exception class now, and with that you can format a better error message for those quite easily.

horeah commented 1 year ago

Yup, sounds about right 😄 Will you submit a new pull request with the "full" fix? Or should I fix it myself?

santagada commented 1 year ago

Fixed the issues and added tests