-
Notifications
You must be signed in to change notification settings - Fork 525
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
Initial creation of paket.config produces malformed file #2003
Comments
@yannisgu IIRC the config feature was your contribution. Are you up for taking a look at this? thx |
@forki, no time right now - maybe @adamralph which possibly "introduced" the bug in #1954? |
I did draw attention (twice) to the addition of the header, but no one seemed to care. |
yeah I got, but I didn't see that it will result in issue ;-) |
I guess what probably needs to happen is the addition of overloads for both |
(If overloads are even a thing in F# - this is where my F# knowledge fails me and prohibits me from sending a no-brainer PR.) 😄 |
Or perhaps |
why is it specifying UTF-16? |
what do you guys think about d1d06b7 ? |
I guess that would work too |
Doesn't System.Xml.XmlWriter handle formatting and XML declarations and formatting and stuff properly for you? Going through that is probably safer than just assuming the file encoding. If nobody minds I can author a pull request that uses that API instead, which should head off any possible future encoding-related problems. |
Sure you can try that. Am 08.11.2016 2:39 vorm. schrieb "Jonathan David Page" <
|
Apparently, d1d06b7 does not fix the problem in all cases. I've got a machine here where paket hasn't been ever used; running v3.30.2. When I first run |
... instead of doing XmlWriter -> string -> disk. - This guarantees that the file encoding and the XML declaration are properly in sync. - Adds a `saveNormalizedXml` function to Utils to facilitate this. - Adds a test to UtilsSpecs for the new function. - Updates ConfigFile.saveConfigNode to use the new function. - Should fix fsprojects#2003 permanently. - Removes the previous fix in commit d1d06b7
Finally got a chance to come back around and do the |
Description
Running
paket config add-credentials
with no existing paket.config file produces a malformed paket.config file (encoding in XML header does not match actual file encoding) which subsequently cannot be read in by paket. Seems to be related to #1954Repro steps
paket config add-credentials <somedomain>
to add to the credential storepaket update
)Environment: Windows 10 Pro, 64-bit, paket 3.26.3 (also seen in 3.23.2).
Expected behavior
Command run in step 2 creates valid paket.config file; command run in step 3 uses the credentials entered in step 2.
Actual behavior
Command run in step 2 writes out a UTF-8 encoded paket.config file, but the
<?xml ... ?>
declaration at the top specifies it to be UTF-16. Command in step 3 is unable to read the file and exits with an error.Known workarounds
Edit the paket.config file after creation so that the
<?xml ... ?>
declaration specifies UTF-8, or have an existing valid paket.config file.The text was updated successfully, but these errors were encountered: