For a white space character (#x20, #xD, #xA, #x9), append a space character (#x20) to the normalized value.

So

"http://www.xmpp.org/extensions/xep-0084.html#ns-data"

and

"http://www.xmpp.org/extensions/xep-0084.html#ns-data "

represent different namespaces. It seems quite unlikely to me that someone intentionally specified the latter value rather than the former, but it seems that the specification forces us to go along with their mistake.

In any case, it seems that the solution of just being more careful about how the values are split up is the correct solution. It will preserve spaces in the value and avoid the later TypeError.

For some reason (possibly age), the build results mention that some tests failed but don't provide logs that show *which* tests failed, so I'm assuming they're known-intermittent failures (otherwise you probably wouldn't have put this patch up for review).

Also, the reference on "how to normalize values" has extra whitespace munging steps for attributes whose type "is not CDATA", but I can't find any reference to what the type of namespace values is. "All attributes for which no declaration has been read SHOULD be treated by a non-validating processor as if declared CDATA", so I guess CDATA is a reasonable assumption.