In Windows when generating a theme_barceloneta the path in the variable package.dottedname in the mrbob.configurator is not correctly splitted by "/" because Windows uses "\" as path separator. Subsequently package.namespace is wrong. Specially if the path contains dots.
split("/") should be replaced with split(os.sep) for it to work in Windows.
I can confirm this solves the problem in Plone-5.2.8 and Plone-5.2.9.
AFAICS this issue should affect Plone-6x too!
What I Did
C:\Users\vagrant\Plone-5.2.9-zeo\py-3.8.10.final.0\Scripts\activate.bat
cd C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\src
rmdir /q/s C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\src\packagename.subpackagename
copy /Y con C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\src\addon.ini
[variables]
author.name = theAuthor
author.email = info@domain.org
author.github.user = gitusername
package.description = An add-on for Plone
package.git.init = True
package.git.autocommit: True
plone.version = 5.2.8
python.version = python3.9
vscode_support = False
^Z
C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\bin\mrbob --config C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\src\addon.ini -O packagename.subpackagename bobtemplates.plone:addon
copy /Y con C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\src\theme_barceloneta.ini
[variables]
subtemplate_warning = n
theme.name = My Theme
package.git.init = False
package.git.autocommit: False
^Z
cd C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\src\packagename.subpackagename
C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\bin\mrbob --config C:\Users\vagrant\Plone-5.2.9-zeo\zeocluster\src\theme_barceloneta.ini -O packagename.subpackagename bobtemplates.plone:theme_barceloneta
Traceback (most recent call last):
File "C:\users\vagrant\Plone-5.2.9\zeocluster\bin\mrbob-script.py", line 31, in <module>
sys.exit(mrbob.cli.main())
File "c:\users\vagrant\plone-5.2.9\buildout-cache\eggs\cp38m\mr.bob-0.1.2-py3.8.egg\mrbob\cli.py", line 181, in main
c.render()
File "c:\users\vagrant\plone-5.2.9\buildout-cache\eggs\cp38m\mr.bob-0.1.2-py3.8.egg\mrbob\configurator.py", line 196, in render
render_structure(self.template_dir,
File "c:\users\vagrant\plone-5.2.9\buildout-cache\eggs\cp38m\mr.bob-0.1.2-py3.8.egg\mrbob\rendering.py", line 94, in render_structure
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\vagrant\\Plone-5.2.9\\zeocluster\\src\\packagename.subpackagename\\src\\C:\\Users\\vagrant\\Plone-5'```
Description
In Windows when generating a
theme_barceloneta
the path in the variablepackage.dottedname
in themrbob.configurator
is not correctly splitted by "/" because Windows uses "\" as path separator. Subsequentlypackage.namespace
is wrong. Specially if the path contains dots.The source of the problem is (https://github.com/plone/bobtemplates.plone/blob/b561328772efc5210196ba02c32de5493155654b/bobtemplates/plone/base.py#L434)
split("/")
should be replaced withsplit(os.sep)
for it to work in Windows.I can confirm this solves the problem in
Plone-5.2.8
andPlone-5.2.9
.AFAICS this issue should affect Plone-6x too!
What I Did
Traceback (most recent call last):