Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspec archive for tgz files on windows #1907

Merged
merged 1 commit into from
Jun 8, 2017
Merged

Conversation

arlimus
Copy link
Contributor

@arlimus arlimus commented Jun 8, 2017

On Windows, inspec archive would sometimes produce incorrect archive files. These would look fine, as tgz files, but would not execute correctly. This would lead to bewildering error messages like this one:

Unable to parse inspec.yml: line 1, control characters are not allowed

Fix it by treating the files as binary before writing them to get around any encoding issues, since the stream handler is a raw io object anyway.

Closely related to #1906

@arlimus arlimus added Type: Bug Feature not working as expected in progress labels Jun 8, 2017
On Windows, `inspec archive` would sometimes produce incorrect archive files. These would look fine, as tgz files, but would not execute correctly. This would lead to bewildering error messages like this one:

```
Unable to parse inspec.yml: line 1, control characters are not allowed
```

Fix it by treating the files as binary before writing them to get around any encoding issues, since the stream handler is a raw io object anyway.

Closely related to #1906

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you @arlimus

@chris-rock chris-rock merged commit 3c1df95 into master Jun 8, 2017
@chris-rock chris-rock deleted the dr/windows-tgz-bug branch June 8, 2017 08:19
@adamleff adamleff changed the title bugfix: inspec archive for tgz files on windows inspec archive for tgz files on windows Jun 8, 2017
aaronlippold pushed a commit to aaronlippold/inspec that referenced this pull request Jun 8, 2017
On Windows, `inspec archive` would sometimes produce incorrect archive files. These would look fine, as tgz files, but would not execute correctly. This would lead to bewildering error messages like this one:

```
Unable to parse inspec.yml: line 1, control characters are not allowed
```

Fix it by treating the files as binary before writing them to get around any encoding issues, since the stream handler is a raw io object anyway.

Closely related to inspec#1906

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants