473,434 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

supressing warning message?

Due to some uninteresting configuration management issues, I'm
running a mismatched python library and getting this message
dumped to stderr.
/.../lib/site-python/Sybase/Sybase.py:20:
RuntimeWarning: Python C API version mismatch for module sybasect:
This Python has API version 1011, module sybasect has version 1012.


While I'm straightening the the CM, everything seems to work well, except
for the warning being printed. Is there a way to intercept or
supress this?

Many TIA!
Mark

--
Mark Harrison
Pixar Animation Studios
Jul 18 '05 #1
2 10215
While I haven't tested this to be sure, "RuntimeWarning" suggests that
this message is coming from the regular warnings machinery. Routines in
the "warnings" module let you silence these warnings.

http://docs.python.org/lib/module-warnings.html

Here's a brute-force way to silence all warnings:
import warnings; warnings.filterwarnings('ignore')
you might want to use something a little more targeted.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBCFT1Jd01MZaTXX0RAsFwAKCjrtYu/dW2terK5youEgfMBYLFdwCgjNOK
+f4IbOWEv/LRChWqT2DbqpA=
=uYPK
-----END PGP SIGNATURE-----

Jul 18 '05 #2
Jeff Epler wrote:
Here's a brute-force way to silence all warnings:
import warnings; warnings.filterwarnings('ignore')
you might want to use something a little more targeted.


Now I'm doing this, and it works perfectly:

warnings.filterwarnings('ignore')
import Sybase
warnings.filterwarnings('always')

Thanks!
Mark
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jp Calderone | last post by:
When using PyChecker on a project which uses bsddb, dozens of messages like the following are reported: warning: couldn't find real module for class bsddb._db.DBAccessError (module name:...
18
by: Lorem Ipsum | last post by:
interesting! I just found a page in which Explorer's View Source does nothing! How did they do that?
5
by: RHPT | last post by:
Is there a way to suprress the HTTP_Referer using VBScript/ASP? Thank you!
1
by: Donagh Berry | last post by:
hi all, I am a newcomer to using modules in microsoft access. I have written code to create a table and append other tables onto it. However, with each step a dialog box appears to ask if I'm sure...
11
by: Michael B Allen | last post by:
Is there a standard method for supressing warnings regarding unused parameters? I have a function that might be called hundreds of thousands of times that looks like this: const void *...
3
by: Herb Stull | last post by:
Hello All, I'd like for my ASP.NET application to look like an application and not have to display the menu and toolbars in the browser window. In order to do this now I use a response.write...
3
by: Tim | last post by:
Hi, I have have a program containing two forms that are open at the same time. The main form updates the second when the user enters input by adding a control to it. My problem is that when the...
2
by: Alex Soto | last post by:
Hi All, I'm developing some scripts to create my schema to be run by other developers and I'd like to have them not spit out those NOTICE messages when you create a table regarding the implicit...
1
by: =?Utf-8?B?RHVzdGlu?= | last post by:
When I run a .vbs file using cscript command in the command prompt I get the following message: Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.