Re: [Zope] Problemwith unicode
2016-06-29 20:46 GMT-05:00 Alberto Berti : > > "Miguel" == Miguel Beltran R writes: > > > Miguel> After search a while, someone can confirm if I undestand it > well? the > Miguel> problem is because it is trying to decode to "ascii" instead > of "iso-8859-1" > > Miguel> if it's true, why is doing it? I set to use iso-8859-1 in my > conf file > > Miguel> 2016-06-28 16:56 GMT-05:00 Miguel Beltran R. < > yourpa...@gmail.com>: > > >> Using the ZMI if I check the "Z SQL Method" the data is displayed > >> correctly, but using a "page template" it gives me this error > >> > >> > >> *Expression: ${items/nombre}'>* > >> > >> - Module zope.tales.expressions, line 263, in > __call__UnicodeDecodeError: > >> 'ascii' codec can't decode byte 0xf3 in position 10: ordinal not in > >> range(128) > >> > > this is due probably because the template engine tries to convert a > string into an unicode, but it doesn't know the charset of your data, so > it's trying to use the default encoding as set in > /usr/lib/python2.7/site.py during interpreter bootstrap. If you are > using a good database you can trust your data and and let the database > connector (the encoding should be settable somewhere in the connector or > Z SQL method conf, i don't remember since i don't use them anymore) > convert the strings to unicodes for you. > > If you have something like MySQL you can't always trust that the data in > the db is in the expected encoding because some of its table engine > simply don't do any check on the input. If this is your case, it will be > more problematic. > > In my experience, setting a default encoding in the config file didn't > always fix the problem. > > As a last resort you can tweak the site.py, but really if there issues > with data's encoding this doesn't mean you solved the problem. Likely > the user will see wrong charachters where non-ascii ones are supposed to > be. > Thanks Alberto!!! :D Changing the enconding in the site.py file made the trick. To some zope developer in the list, why is not taking the enconding from the zope.conf file? Do I must open a ticket? -- Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ODBC adapter
On 07/04/2016 12:08 PM, Miguel Beltran R. wrote: > Using zope 2.13.23 ZPyODBCDA 1.0.9.dev0 ( > https://github.com/tcurvelo/Products.ZPyODBCDA ) > > I have tried to install ZpyODBCDA but when I try to start the > instance i got this error > > (control-emisiones3) > N:\zope\control-emisiones3>"N:\zope\control-emisiones3\Scripts\runzope" > > -C "N:\zope\control-emisiones3\instance_zope\etc\zope.conf" > > 2016-07-04 10:48:05 ERROR Application Could not import > Products.ZPyODBCDA Traceback (most recent call last): ... > "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\pyodbc_db.py", > line 37, in > from Shared.DC.ZRDB.TM import TM ImportError: No module named ZRDB.TM > > > What module do I need to install? Products.ZSQLMethods split off in in the Zope 2.13.x series. https://pypi.python.org/pypi/Products.ZSQLMethods/ You might submit an issue to the tracker for Products.ZPyODBCDA suggesting the add it as a dependency. Tres. -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] ODBC adapter
Hi again list, Using zope 2.13.23 ZPyODBCDA 1.0.9.dev0 ( https://github.com/tcurvelo/Products.ZPyODBCDA ) I have tried to install ZpyODBCDA but when I try to start the instance i got this error (control-emisiones3) N:\zope\control-emisiones3>"N:\zope\control-emisiones3\Scripts\runzope" -C "N:\zope\control-emisiones3\instance_zope\etc\zope.conf" 2016-07-04 10:48:05 ERROR Application Could not import Products.ZPyODBCDA Traceback (most recent call last): File "n:\zope\control-emisiones3\lib\site-packages\OFS\Application.py", line 606, in import_product product=__import__(pname, global_dict, global_dict, silly) File "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\__init__.py", line 27, in from pyodbc_browser import pyodbcConnectionBrowser, addpyodbcConnectionBrowser, addpyodbcConnectionForm File "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\pyodbc_browser.py", line 23, in from pyodbc_DA import pyodbcConnection, database_type, addpyodbcConnectionForm File "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\pyodbc_DA.py", line 27, in from pyodbc_db import DB File "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\pyodbc_db.py", line 37, in from Shared.DC.ZRDB.TM import TM ImportError: No module named ZRDB.TM Traceback (most recent call last): File "C:\Python27\Lib\runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "C:\Python27\Lib\runpy.py", line 72, in _run_code exec code in run_globals File "N:\zope\control-emisiones3\Scripts\runzope.exe\__main__.py", line 9, in File "n:\zope\control-emisiones3\lib\site-packages\Zope2\Startup\run.py", line 22, in run starter.prepare() File "n:\zope\control-emisiones3\lib\site-packages\Zope2\Startup\__init__.py", line 86, in prepare self.startZope() File "n:\zope\control-emisiones3\lib\site-packages\Zope2\Startup\__init__.py", line 262, in startZope Zope2.startup() File "n:\zope\control-emisiones3\lib\site-packages\Zope2\__init__.py", line 47, in startup _startup() File "n:\zope\control-emisiones3\lib\site-packages\Zope2\App\startup.py", line 67, in startup OFS.Application.import_products() File "n:\zope\control-emisiones3\lib\site-packages\OFS\Application.py", line 583, in import_products import_product(product_dir, product_name, raise_exc=debug_mode) File "n:\zope\control-emisiones3\lib\site-packages\OFS\Application.py", line 606, in import_product product=__import__(pname, global_dict, global_dict, silly) File "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\__init__.py", line 27, in from pyodbc_browser import pyodbcConnectionBrowser, addpyodbcConnectionBrows er, addpyodbcConnectionForm File "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\pyodbc_browser.py", line 23, in from pyodbc_DA import pyodbcConnection, database_type, addpyodbcConnectionForm File "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\pyodbc_DA.py", line 27, in from pyodbc_db import DB File "N:\zope\control-emisiones3\instance_zope\Products\ZPyODBCDA\pyodbc_db.py", line 37, in from Shared.DC.ZRDB.TM import TM ImportError: No module named ZRDB.TM What module do I need to install? -- Lo bueno de vivir un dia mas es saber que nos queda un dia menos de vida ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )