My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 7: Python 2.6 switch '-3' produces DeprecationWarning on import of pyodbc
2 people starred this issue and may be notified of changes. Back to list
Status:  Complete
Owner:  ----
Closed:  Dec 2008


 
Reported by tarkatronic, Dec 1, 2008
The '-3' switch was added to Python 2.6 in order to provide warnings for
deprecated usages in Py3k. Currently the only warning I have seen is the
following, upon import:
pyodbc.pyd:6: DeprecationWarning: the sha module is deprecated; use the
hashlib module instead

This will break compatibility with Python 3.0 (although I'm not sure this
is even in the immediate roadmap)

However, given that hashlib was introduced in 2.5, you will need to use
some sort of try/except import hack to maintain the current level of
backwards compatibility. Something along the lines of:
try:
    from hashlib import sha1 as sha
except ImportError:
    from sha import sha

Dec 1, 2008
Project Member #1 mkleehammer
Thanks.  I actually have that in the C++ code, but I commented it out to make sure it
worked if hashlib wasn't found.  Unfortunately, I forgot and left it commented out. 
I'll check it in soon.

Status: Accepted
Dec 5, 2008
Project Member #2 mkleehammer
Fixed in 2.1.2
Status: Fixed
Nov 21, 2010
Project Member #3 mkleehammer
(No comment was entered for this change.)
Status: Complete

Powered by Google Project Hosting