I want to edit python library in Visual Studio Code. I dont know how to do it and editing in another folder and then sudo cp edited_file library_path is annoying.

I tried something like sudo ./Visual\ Studio\ Code but it raise bash: cannot set terminal process group (XXX): Inappropriate ioctl for device

Has anyone idea, how to do it? Thank you

  • 2
    normally, there is no need to ever edit a standard library. At the simplest, you can copy the file to your home directory, edit it there and change you python program to tell it to look there before the standard place. Beyond that, python allows you to subclass a library so you just need to add your modification in your program. see tutorial
    – meuh
    Jun 25, 2016 at 9:14

1 Answer 1


Can python stdlib files be directly edited? Yes, generally, although some of them are compiled C extensions, which you won't be able to.

Can you run Visual Studio as root? I'm not sure, but it's such a complicated program that's it's probably a better idea, from a security perspective, not to. Anyways, using sudo for gui programs can cause all sorts of weird permission errors, so you should use kdesudo or gtksudo instead.

Finally, should you be editing the python stdlib? Almost certainly not - you're changing behavior that everyone else is relying on. What is motivating you to do this?

  • I have installed tlslite-ng and want to add new functions to this TLS library, but its installed among others python libraries.
    – Mildas
    Jun 25, 2016 at 15:34
  • Then you should probably fork the source repo and make your changes, and locally install that (and submit your changes upstream). I would also highly recommend having a good talk with the upstream developer before you do any work on this to see if what you're planning is a good idea, especially since you're dealing with crypto code. Jul 6, 2016 at 18:56
  • thanks for your response. Upstream developer know about it :) But I was ashamed to ask him "how to properly edit that library and try, if it works"
    – Mildas
    Jul 12, 2016 at 1:20
  • Don't be! People come with all different levels of knowledge about different things, and he should be glad to help you with that; if not, then he's an ass and you don't want to contribute to his project anyways. Jul 13, 2016 at 1:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .