Re: Simple postgresql.conf wizard

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: Simple postgresql.conf wizard
Дата
Msg-id Pine.GSO.4.64.0812011235280.13553@westnet.com
обсуждение исходный текст
Ответ на Re: Simple postgresql.conf wizard  ("Robert Haas" <robertmhaas@gmail.com>)
Ответы Re: Simple postgresql.conf wizard  ("Robert Haas" <robertmhaas@gmail.com>)
Список pgsql-hackers
On Mon, 1 Dec 2008, Robert Haas wrote:

> I just gave this a try and got:
>
> $ ./pgtune
> Traceback (most recent call last):
>  File "./pgtune", line 20, in <module>
>    from ctypes.wintypes import *
>  File "/usr/lib/python2.5/ctypes/wintypes.py", line 21, in <module>
>    class VARIANT_BOOL(_SimpleCData):
> ValueError: _type_ 'v' not supported

Looks like I need to add Python 2.5+Linux to my testing set.  I did not 
expect that the UNIX distributions of Python 2.5 would ship with 
wintypes.py at all.  I think I can fix this on the spot though.  On line 
40, you'll find this bit:

except ImportError:

Change that to the following:

except ImportError,ValueError:

And it should pass that point.  If it doesn't, you can try the completely 
general:

except:

And then it should be OK.  I should probably use that formulation in that 
particular section.

> (This is also my #1 beef with Python: too many utterly impenetrable
> error messages... or at least impenetrable to me.)

That one made sense to me, but that is one of the sharper parts of its 
learning curve.  I think part of the problem is that much of the tutorial 
Python code out there never gets into error handling.  One of the things 
Java does that I miss is that if you create a "try" block, it won't work 
until you have addressed every possible exception the code in there can 
generate.  It may be impractical for Python to know that much, but I 
wonder if a lint-ish tool for the language might be able to do it.

The above mumbling is certainly off-topic for this list though.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Simple postgresql.conf wizard
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Simple postgresql.conf wizard