Re: ODBC Connect config file
"Charlie Clark" <[email protected]>
| Newsgroups | gmane.comp.python.egenix.user |
|---|---|
| Organization | eGenix.com |
| Message-ID | <[email protected]> |
Am 13.06.2009, 21:41 Uhr, schrieb Tentin Quarantino <[email protected]>: > # host = 192.168.1.100 # a comment > host = 192.168.1.121 # a comment > port = 6632 > using_ssl = 0 > Apparently, putting a comment after the "name = value" pair will cause > the software to fail and the resulting error message could possibly > mislead the programmer, IMHO. > 0010 2009-06-13 12:31:26.87 [p2561] Could not open log file "<open > file 'test-client.log', mode 'w' at 0x2d85c0>" - using stderr > 0500 2009-06-13 12:31:26.87 [p2561] Connection to 10.10.3.252 #:6632 > failed - fail-over to the next. > 0010 2009-06-13 12:31:26.87 [p2561] ERROR: None of the configured > mxODBC Connect Servers allow connections. > I believe it would be better to have a layer of error checking between > the place where the program reads the config file and where that data > is delivered to the code that uses it. i.e. check & sanitize the data > before using it. > If error handling and messaging was slightly more helpful, then the > marginal improvement would move ODBC Connect toward real world clas > product status. Hiya, actually the solution is to use the correct comments for the file format! ;-) See http://en.wikipedia.org/wiki/INI_file for more details and check out the ConfigParser module in the standard library. Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ _______________________________________________________________________ eGenix.com User Mailing List http://www.egenix.com/ https://www.egenix.com/mailman/listinfo/egenix-users