473,326 Members | 2,111 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,326 software developers and data experts.

Question about FutureWarning

I have module M1 which has the following line in it:

StartTime = safe_dict_get ( dic, 'starttime', 0xFFFFFFFF )

It gets imported by modules M2 and M3. And finally, M4 imports both M2 and
M3.

M4
|\M3
| |\M1
|\M2
| |\M1

I'm building a .deb file which means I have to compile the modules into
..pyc and .pyo files.

The compile command I use is

python=/usr/bin/python2.3
i_python ()
{
$python -c "import $1"
$python -O -c "import $1"
}
i_python M1
i_python M2
i_python M3
i_python M4

When M1 is compiled, there's no problem. The same for when I compile M2
and M3. But when M4 is compiled, I get the following message:

M1.py:268: FutureWarning: hex/oct constants sys.maxint will
return positive values in Python 2.4 and up
StartTime = safe_dict_get ( dic, 'starttime', 0xFFFFFFFF )

I get the message twice, ostensibly because of M3 and M2.

I was able to shut off the warning by adding the following lines *before*
the import in M4.

import warnings
warnings.filterwarnings('ignore', category=FutureWarning)

My question is this: Why can the warning not be shut off by putting the
two lines in M1?

TIA

--
Time flies like the wind. Fruit flies like a banana. Stranger things have .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
Aug 14 '07 #1
0 954

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

Similar topics

6
by: Bengt Richter | last post by:
>>> hex(-5) __main__:1: FutureWarning: hex()/oct() of negative int will return a signed string in Python 2.4 and up '0xfffffffb' >>> hex(-5) '0xfffffffb' >>> hex(-5L) '-0x5L' That is sooo...
1
by: Egor Bolonev | last post by:
================= C:\Documents and Settings\ŠÕÀ³\My Documents\Scripts\octopus_eye\1\oct_eye_db.py: 213: FutureWarning: hex()/oct() of negative int will return a signed string in P ython 2.4 and...
8
by: Grant Edwards | last post by:
How do I get rid of the following warning? <path>.py:233: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up...
0
by: Chris Curvey | last post by:
Hi all, When trying to automate IE thru win32com (using PAMIE), I'm getting this message out C:\Program Files\Plone 2\Python\lib\site-packages\win32com\client\dynamic.py:463 : FutureWarning:...
14
by: kosuke | last post by:
I keep getting the following error/warning message when using the python based program getmail4: /usr/lib/python2.3/optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a...
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
5
by: Steven W. Orr | last post by:
I'm trying again, since no response indicates that I'm not providing enough info. I have module M1 which has the following line in it: StartTime = safe_dict_get ( dic, 'starttime',...
2
by: hofer | last post by:
Hi, I get following warning with a python script: optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a signed string in Python 2.4 and up my code:
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.