Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1443

Use Windows-safe methods for tempfiles and env vars.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.14.1
    • Component/s: None
    • Template:
    • Team:
      Puppet Developer Experience
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      PDK now reads command output in binary mode, preserving the line endings used on Windows.

      Environment variables on Windows are now accessed via the internal Windows kernel32 methods, preserving non-ASCII values in the environment variables.
      Show
      PDK now reads command output in binary mode, preserving the line endings used on Windows. Environment variables on Windows are now accessed via the internal Windows kernel32 methods, preserving non-ASCII values in the environment variables.
    • QA Risk Assessment:
      Needs Assessment

      Description

      From https://github.com/puppetlabs/pdk/pull/712

      lib/pdk/cli/exec/command.rb uses {{@stdout = Tempfile.new('stdout').tap

      { |io| io.sync = true }

      }}

      Warning: Tempfile doesn't set binary mode, so CRLF will be used on Windows which may not be what you want

      lib/pdk/cli/exec/command.rb uses ENV['PATH']

      Warning: ENV has known issues with non-ASCII characters on Windows environment variables. https://github.com/puppetlabs/puppet/blob/eb19bedb221959bd202e598401a3d29ea77950c9/spec/unit/util_spec.rb#L99-L218

      Typically this comes from non-English Usernames e.g. C:\Users\jm├╝ller

      We should be using binary mode for text files, and the internal puppet ENV helpers for environment variables on Windows.

        Attachments

          Activity

            People

            Assignee:
            tim.sharpe Tim Sharpe
            Reporter:
            glenn.sarti Glenn Sarti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support