"Building updates[Error]: Illegal characters in path."

I'm trying to build an update from the command line. My generated xml to add the files looks like this:

<?xml version="1.0" encoding="utf-8"?><Versions>    <AddVersion>        <Version>            110721.1441        </Version>        <Files dir="basedir">            <File source="c:\Users\xyz\Prog\myprogrambase\inputs\releases\myprogram\admin\110721.1441\botan.dll"/>            <File execute="after" source="c:\Users\xyz\Prog\myprogrambase\inputs\releases\myprogram\admin\110721.1441\myprogramadmin.exe" startstyle="normal" waitforexit="false"/>        </Files>        <Files dir="basedir\otherfiles">            <File source="c:\Users\xyz\Prog\myprogrambase\inputs\releases\myprogram\admin\110721.1441\otherfiles\otherfile1.dat"/>            <File source="c:\Users\xyz\Prog\myprogrambase\inputs\releases\myprogram\admin\110721.1441\otherfiles\otherfile2.dat"/>        </Files>    </AddVersion></Versions>

The commandline is:

wybuild.cmd.exe <.wyp filename> /bu /bwu -add <xml filename> -catchall="true" -vs=<mystartversion> -ve=<myendversion>

The output is:

Building updates[Error]: Illegal characters in path.

That should be a little more helpful 🙂. Which path? Path of the inputs? Path that I provide in the commandline? Both seem fine to me. How can I solve this?

Oh, I think I solved it. In the python script which executes wybuild, I had to add the "-add <xmlfile>" as one parameter, not two after each other.

wybuild = subprocess.call([WYBUILD, r'{base}\inputs\updaters\{id}\{k}\project.wyp'.format(base=BASEDIR, id=edition['internalId'], k=kind), '/bu', '/bwu', '-add {}'.format(xml_filename)])

BUT 🙂 now I get this:

[Error]: An error occured while trying to add versions from the file "myprogramadmin110721.1452.xml":

The given path's format is not supported.

Which path, again? 🤔

I'm going to take a shot in the dark here and say the problem looks like the space you have between "-add" and the XML filename. Also, you're not putting quotes around the filename (which is almost always a mistake).

So instead of this:

wybuild.cmd.exe <.wyp filename> /bu /bwu -add <xml filename> -catchall="true" -vs=<mystartversion> -ve=<myendversion>

Try this:

wybuild.cmd.exe "<.wyp filename>" /bu /bwu -add="<xml filename>" -catchall="true" -vs="<mystartversion>" -ve="<myendversion>"

Notice the quotes around all the parameters (the *.wyp file, the XML file, the start and end versions).

Thanks for the answer Sam. I did as you advised, but the problem persists. The subprocess module of python is supposed to take care of such problems anyway, so it's definitely not the quoting. Though the equal sign was obviously missing after the -add. If I type the same commandline by hand in cmd.exe, I get the same error.

With the upcoming update, could you make this error message a bit less cryptic? I mean, I don't even know if it's something on the command line, or something in the xml. It should display the problematic path and show which characters are invalid. Could it be that the '.' (dot) character in the path confuses it?

Also, I can send you the exact xml file I generated, I just didn't feel comfortable posting it online. If you need it, please send me and e-mail address where I can send it.

Send it to me and I'll take a look at it. wyatt@wyday.com

You're right about the error messages being cryptic. We're working to improve that.

Hello guys,

Here is my workaround and a little explanation about a possible cause. First, the code. Sadly, I was unable to make Python spit out a not-only-seemingly valid file. I fired up my rudimentary PowerShell skills, and I made a script that generates the xml. It is ugly and possibly otherwise bad code, so use with caution. I'm not experienced in PS, so there are probably much nicer solutions. But it works, and I'm OK with this.

It takes the following arguments (in this order): the new version number as a string; the absolute path of the directory where the release files are stored; the name of the main executable (without path).

Here is the script (I can't enable BBCode to format nicely, sorry):

$newversion = $args[0]


$doc = New-Object xml$addversion = $doc.AppendChild($doc.CreateElement("Versions")).AppendChild($doc.CreateElement("AddVersion"))$version = $doc.CreateElement("Version")$version.set_InnerText($newversion)$addversion.AppendChild($version)$dirname = $args[1]$directories = @($dirname)$directories += Get-ChildItem -Recurse $dirname | Where {$_.psIsContainer -eq $true} | foreach-object -process { $_.FullName }$exename = $args[2]


foreach($d in $directories){	if ($d -eq $dirname)	{		$dir = "basedir"		}	else	{		$dir = "basedir" + "\" + $d.Substring($d.LastIndexOf('\')+1)	}	$node_files = $doc.CreateElement("Files")	$node_files.SetAttribute("dir", $dir)	$flist = Get-ChildItem $d | foreach-object -process { $_.FullName }


	foreach ($f in $flist)	{		if (![System.IO.File]::Exists($f)) { continue; }		$node_f = $doc.CreateElement("File")		$node_f.SetAttribute("source", $f)		$node_files.AppendChild($node_f) | Out-Null		if ([System.IO.Path]::GetFileNameWithoutExtension($f) -eq $exename)		{			$node_f.SetAttribute("execute", "after")			$node_f.SetAttribute("startstyle", "normal")			$node_f.SetAttribute("waitforexit", "false")		}			}	$addversion.AppendChild($node_files) | Out-Null}


$writer = New-Object System.Xml.XmlTextWriter("version.xml", [System.Text.Encoding]::UTF8)$writer.Formatting = [System.Xml.Formatting]::Indented$doc.Save($writer)$writer.Close()

A possible cause: The XML 1.0 specification bans certain UTF-8 characters. The Python minidom module, which I used to write the xml, outputs proper UTF-8 and well-formed xml, but not neccessarily valid XML due to these banned characters. See this: http://maxharp3r.wordpress.com/2008/05/15/pythons-minidom-xml-and-illegal-unicode-characters/Now, I did try the solution in this blog, and another one from another site, but they didn't help. This can be an encoding issue, or the absence or presence of a BOM (depending on what wybuild excepts).

Hope this helps someone.

We were unable to reproduce you original problem (the XML file added fine). It might be the missing "encoding="utf-8"" element in the "<?xml ...>" block. That is, your original file looks like this:

<?xml version="1.0" ?>

And your new xml looks like this:

<?xml version="1.0" encoding="utf-8"?>

We're still investigating the cause.

Thanks, I'm good for now with the workaround. Let me know if I can provide additional information. I'll keep all related files.