Tcl Library Source Code

View Ticket
Login
Ticket UUID: 800c0dc7c13cdeb6fc42eb2363ef5befa7906ccc
Title: yaml::yaml2dict inserts spaces on quoted line continuation
Type: Bug Version: 0.4.1
Submitter: jdwk4k Created on: 2022-03-30 03:13:43
Subsystem: yaml Assigned To: aku
Priority: 5 Medium Severity: Severe
Status: Open Last Modified: 2022-05-26 06:41:04
Resolution: None Closed By: nobody
    Closed on:
Description:
I need to break a string into multiple lines with no spaces.
The string is a filename.

According to a few threads on stack overflow the following should give me the desired output.

alphabet:
  "abcdefghi\
  jklmnopqr\
  stuvwxyz"

With python yaml it does result in a string with no spaces.
'alphabet': 'abcdefghijklmnopqrstuvwxyz'

But with TCL, I still get the spaces.
'alphabet': 'abcdefghi jklmnopqr stuvwxyz'

I don't have a good work around for this other than turning off the line-length rule and ignoring the line-wrap.

Not sure how active the development is on tlclib anymore, but hopefully, this can still be addressed.

Thanks,
Justin
User Comments: jdwk4k added on 2022-05-26 06:41:04:
Sorry, I don't think I ever got a mail saying someone had actually replied.  Or perhaps it was trashed as spam.
Only thought to check this because I ran into a separate issue.

The command is used is

::yaml::yaml2dict

I haven't yet looked at the TclYAML link.  Looks like an alternative Tcl library?
If that is more actively developed, that is probably the way to go.
Thanks,
Justin

aku added on 2022-04-08 19:59:43:

Please tell me which command of the yaml package you used and how it was invoked.

As I am not the author of the package anything more rigid to repro the issue would be helpful. Even so I am not willing to promise that I will be able to fix the issue.

I also hope that you will not mind me pointing you towards TclYAML which is a Tcl binding to the official C-based yaml parser.