Python 2.6 and deprecated modules
Matthew Knepley
knepley at gmail.com
Mon Jul 13 17:54:00 CDT 2009
On Mon, Jul 13, 2009 at 4:56 PM, Lisandro Dalcin <dalcinl at gmail.com> wrote:
> On Mon, Jul 13, 2009 at 6:47 PM, Matt Knepley<knepley at gmail.com> wrote:
> > I like 1) as well. However someone needs to test the fixes on ancient RH
> > python.
> >
>
> No problem, I have custom installs of old Python's starting from 2.3
> and up to current SVN trunk (2.7)... Do you remember what version is
> the ancient RH Python you are talking about?
>
I think 2.3 is alright. It still needs foo(object) and stuff.
Matt
> > Matt
> >
> > From the phone
> >
> > On Jul 13, 2009, at 1:15 PM, Lisandro Dalcin <dalcinl at gmail.com> wrote:
> >
> >> Fedora 11 moved to Python 2.6. Now many Python stdlib modules are
> >> deprecated (as part of the transition to Python 3.x series).
> >>
> >>
> /u/dalcinl/Devel/PETSc/petsc-dev/config/BuildSystem/config/compilers.py:7:
> >> DeprecationWarning: the sets module is deprecated
> >> import sets
> >> /u/dalcinl/Devel/PETSc/petsc-dev/config/PETSc/package.py:7:
> >> DeprecationWarning: the md5 module is deprecated; use hashlib instead
> >> import md5
> >> /u/dalcinl/Devel/PETSc/petsc-dev/config/BuildSystem/script.py:101:
> >> DeprecationWarning: The popen2 module is deprecated. Use the
> >> subprocess module.
> >> import popen2
> >>
> >> We could take two approaches to remove these warnings (I bet all you
> >> hate warnings as much as me):
> >>
> >> 1) Reimplement things using the modern API's, perhaps by using
> >> conditional code depending on the Python version and/or using import
> >> with try/except blocks. In particular, this will require:
> >> a) use the builtin 'set' type (available since Python 2.4)
> >> b) use the 'hashlib' module (available since Python 2.5)
> >> c) moving from using 'peopen2' to 'subprocess' (BTW, available since
> >> Python2.4) will likely remove the need to use 'select', which I
> >> commented some time ago it is not supported (for pipes) in native
> >> Windows Python (yes, some day I'll have some working code with the
> >> native Windows Python).
> >>
> >> 2) Silent these warnings. I do not think these modules will be ever
> >> removed from 2.x series, and porting the whole BuildSystem beast to
> >> Python 3.0 is not going to be a 10-minutes task anyway.
> >>
> >>
> >> I personally prefer (1) and volunteer to provide the fixes, even if
> >> that is more work than (2). I would like to know your opinions before
> >> start to work on this.
> >>
> >>
> >> --
> >> Lisandro Dalcín
> >> ---------------
> >> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> >> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> >> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> >> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> >> Tel/Fax: +54-(0)342-451.1594
> >
>
>
>
> --
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
>
--
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20090713/edf89643/attachment.html>
More information about the petsc-dev
mailing list