Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58053

Impossible to run a QProcess with an empty environment

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.3.0 Alpha
    • 5.8.0 RC, 5.15.6, 6.2.0
    • Core: I/O
    • None
    • 8
    • 5fc9c02a695edca23c0f8b2ec4c258e2c4212ea8 (qt/qtbase/dev)
    • Team 1 Foundation_Sprint 45, Team 2 Foundation_Sprint 46

    Description

      With:

      QProcess p;
      p.setProcessEnvironment(QProcessEnvironment());
      p.start();
      

      ... in the child process, you'll still end up with a copy of the system environment.

      I'm not sure if this is deliberate (maybe it is, since the default QProcessEnvironment is "empty", and that's used to say "copy the system environment"), but it should be fixed in docs if so, as right now it's ambiguous:

      If no environment has been set, the environment of the calling process will be used.
      

      ... to me, implies that the requirement is to call setProcessEnvironment with an environment of my choice, even if I choose it to be empty.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ievgenii.meshcheriakov Ievgenii Meshcheriakov
            w00t Robin Burchell
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes