-
Notifications
You must be signed in to change notification settings - Fork 96
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
A couple of questions about default-zpublisher-encoding #571
Comments
Don't get hung up about something as inconsequential as a small class that doesn't get used, please. There's more important stuff to do, really. |
Jürgen Gmach wrote at 2019-4-27 23:45 -0700:
1. The only documentation about that option seems to be the CHANGES.rst and the NEWS.rst.
Zope relies on `ZConfig` for its configuration.
`ZConfig` gets the configuration options applicable for a given
application or application component from an XML file
(usually called `component[s].xml` or `***schmema.xml`).
The schema has (typically) detailed documentation for each option.
The `Zope2 2.x` schema is `Zope2.Startup:zopeschema.xml`.
Both refer to zope.conf.
What formerly was `zope.conf` is now called `wsgi.conf` (at least
for the WSGI setup).
I find this suboptimal, because the configuration therein is mainly
for the parts of Zope independent from WSGI/ZServer.
I would prefer if the name would remain `zope.conf`.
I installed Zope via
`$ bin/buildout -c zope-ecosystem.cfg`
and under `etc/` there is only a wsgi.conf and a zope.ini, no zope.conf.
See above.
Afaik `zope.conf` came with ZServer, which is no longer the default, and zope.ini / wsgi.conf comes with the new wsgi way.
Right.
If that's correct, we should update the news.rst.
2. Can anybody please explain what is the "wsgischema.xml" for?
See the remarks above about `ZConfig`.
...
Is this a config file or only documentation?
It is some kind of "meta configuration" telling `ZConfig`
which options are allowed in an application or component
configuration file (in the current case `wsgi.conf`)
and how these options should be processed.
|
What the configuration name is called, be it wsgi.conf or zope.conf, was just convention. I believe the intent was to say "this is a zope configuration for WSGI setups only", because it is likely to fail when starting a ZServer instance with it. There are some configuration keys that differ. I'm open to switch the naming so that |
Jens Vagelpohl wrote at 2019-4-28 10:32 -0700:
...
I'm open to switch the naming so that `mkwsgiinstance` creates a zope.conf and a wsgi.ini as opposed to a wsgi.conf and a zope.ini, but is this really important?
It is cosmetics.
But, it is also more natural and fits better with the existing
documentation.
|
Beginning with ZConfig 3.2, ZConfig ships with a Sphinx extension that can automatically publish that documentation. (For example, that's how ZConfig's logging documentation is generated.) .. zconfig:: Zope2.Startup
:file: wsgischema.xml |
@jamadden Have you actually tried that ZConfig Sphinx directive? It appears to expect files starting with
Full traceback:
|
I didn't realize it wasn't actually a component file when I made that above remark. It's true that directive currently just takes component files. I think there may be a workaround involving a dummy component file, but ideally the ZConfig directive would just handle that. (zopefoundation/ZConfig#59) |
I've got a PR to ZConfig to make the directive handle schemas. |
@jamadden Thank you! I'm not sure how active they are, though. |
I wrote the original Sphinx extension plus this PR and I have PyPI access for ZConfig, so getting it released won't be an issue. We just need someone to swing by and review. I've had several different reviewers in that repo in the past, usually within a day or so. |
Great - sorry, I had not clicked on the link to the PR, otherwise I wouldn't have said that. |
A configuration reference based on the schema is now live at https://zope.readthedocs.io/en/latest/operation.html#configuration-reference |
When revising #564 @dataflake made me aware of the
default-zpublisher-encoding
option.I have a couple of questions /annotations about that one.
Both refer to zope.conf.
I installed Zope via
$ bin/buildout -c zope-ecosystem.cfg
and under
etc/
there is only a wsgi.conf and a zope.ini, no zope.conf.Afaik
zope.conf
came with ZServer, which is no longer the default, and zope.ini / wsgi.conf comes with the new wsgi way.If that's correct, we should update the news.rst.
Zope/src/Zope2/Startup/wsgischema.xml
Lines 266 to 273 in 9b2d948
Is this a config file or only documentation?
I'd assume it's a config file, as it gets loaded here..
Zope/src/Zope2/Startup/options.py
Lines 52 to 60 in 882629f
Having a look at...
Zope/src/Products/PageTemplates/unicodeconflictresolver.py
Lines 47 to 69 in 882629f
I'd think the docstring is wrong.
a) the encoding is not used from "
default-zpublisher-encoding
" but from"
ZPublisher.HTTPRequest.default_encoding
" which is hardcoded to "utf-8
."Zope/src/ZPublisher/HTTPRequest.py
Lines 55 to 56 in 882629f
b) the fallback is "
iso-8859-15
", and not "sys.getdefaultencoding
".c) Does the class even get used?
The class gets used at the bottom of the module
Zope/src/Products/PageTemplates/unicodeconflictresolver.py
Lines 127 to 132 in 882629f
but these new identifiers are only used for tests.
So it looks like the code could be removed.
I have done a quick search on github - no results except the tests. Or is that a public API we'd have to deprecate?
The text was updated successfully, but these errors were encountered: