[Patches] [ python-Patches-562373 ] Getting rid of string, types and stat

noreply@sourceforge.net noreply@sourceforge.net
Thu, 06 Jun 2002 02:53:16 -0700


Patches item #562373, was opened at 2002-05-30 16:18
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=562373&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
>Resolution: Fixed
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Walter Dörwald (doerwalter)
Summary: Getting rid of string, types and stat

Initial Comment:
This patch gets rid of some of the "import string",
"import types" or "import stat" statements in the
standard library (many still remain, I didn't touch the
tools or Demos directory). I hope I didn't touch any of
the modules that must stay backwards compatible (like
inspect, distutils, sre, anything else?)

Maybe the rest of the function in stat should be made
methods too?


----------------------------------------------------------------------

>Comment By: Walter Dörwald (doerwalter)
Date: 2002-06-06 11:53

Message:
Logged In: YES 
user_id=89016

Raymond Hettinger has fixed most of the stat stuff already.
Only Lib/fileinput.py and Lib/shutil.py remained. The
versions checked in are:

Lib/fileinput.py 1.13
Lib/shutil.py 1.21


----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-06-04 19:41

Message:
Logged In: YES 
user_id=33168

Yes, do the stat changes too (make sure to fix the a_tim
noted below in ntpath).
Also, could you update the PEP 42 section
which discusses os.stat()/os.statvfs() using attributes.
If the bug referenced is fixed, that should be closed too.
Thanks.

----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2002-06-04 19:26

Message:
Logged In: YES 
user_id=89016

string and types is done. Should I check in the os.stat
changes too?

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-05-31 22:03

Message:
Logged In: YES 
user_id=33168

Making other functions in stat methods may be a good idea,
bring it up on python-dev.

I have made the change string -> basestring.
So once you make the changes mentioned in my previous
comment and run the tests, go ahead and check in.

I'm not sure if the code being changed has unit tests.
It would be nice to add those too.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-05-31 21:37

Message:
Logged In: YES 
user_id=33168

Note some of these have already been fixed (sorry).
Hopefully there won't be conflicts.

return st.st_atim should be st_atime in ntpath.

Note, string will be changed to basestring per discussion on
python-dev.

At one point, unittest was supposed to remain compatible
with 1.5.2.
I'm not sure if this is still the case.  You should probably
hold off
on that one file.

Once I finish the basestring change, I'll assign the patch
back to
Walter.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=562373&group_id=5470