[ python-Bugs-1687314 ] Round funcion
Bugs item #1687314, was opened at 2007-03-24 11:02 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1687314&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Gust1 (gust1) Assigned to: Nobody/Anonymous (nobody) Summary: Round funcion Initial Comment: I don't quite know if it is a bug, but when I do this in the interpreter (see blow) the third return is not what i wanted. >>> round(5.5, 3) 5.5 >>> round(5.55, 3) 5.556 >>> round(5.55, 2) 5.5596 I created a function to solve this. It can be found attached to this report. I'm sorry but I'm not English so I don't speak this language very good. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1687314&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1687314 ] Round funcion
Bugs item #1687314, was opened at 2007-03-24 11:02 Message generated for change (Comment added) made by gbrandl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1687314&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.5 >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Gust1 (gust1) Assigned to: Nobody/Anonymous (nobody) Summary: Round funcion Initial Comment: I don't quite know if it is a bug, but when I do this in the interpreter (see blow) the third return is not what i wanted. >>> round(5.5, 3) 5.5 >>> round(5.55, 3) 5.556 >>> round(5.55, 2) 5.5596 I created a function to solve this. It can be found attached to this report. I'm sorry but I'm not English so I don't speak this language very good. -- >Comment By: Georg Brandl (gbrandl) Date: 2007-03-24 11:37 Message: Logged In: YES user_id=849994 Originator: NO This is invalid. See http://www.python.org/doc/faq/general/#why-are-floating-point-calculations-so-inaccurate. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1687314&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1619641 ] format error in 2.5 ref.pdf in section 5.3.4 Calls
Bugs item #1619641, was opened at 2006-12-20 19:12 Message generated for change (Comment added) made by zseil You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1619641&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Documentation Group: Python 2.5 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: cwm42 (cwm42) Assigned to: Nobody/Anonymous (nobody) Summary: format error in 2.5 ref.pdf in section 5.3.4 Calls Initial Comment: Formatting error in Python 2.5 ref.pdf page 41, section 5.3.4 Calls, downloaded from docs.python.org on 12/20/06. The first part of the table which is centered in the html version is shifted off the right side of page and clipped. This problem occurs with both kpdf and kghostview. -- >Comment By: Žiga Seilnacht (zseil) Date: 2007-03-24 15:39 Message: Logged In: YES user_id=1326842 Originator: NO This was fixed with patch #1489771 in rev. 54559, 54560 (2.5). -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1619641&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1595164 ] texinfo library documentation fails to build
Bugs item #1595164, was opened at 2006-11-12 20:15
Message generated for change (Comment added) made by zseil
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1595164&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mark Diekhans (diekhans)
Assigned to: Nobody/Anonymous (nobody)
Summary: texinfo library documentation fails to build
Initial Comment:
Attempting to build the texinfo documentation generates
the error (args-out-of-range 2931944 2931946).
This occurs in download of 2.5 latex doc and from trunk
of svn tree.
elisp stack trace attached.
It would be really nice if texinfo doc was still
available for download.
--
>Comment By: Žiga Seilnacht (zseil)
Date: 2007-03-24 17:38
Message:
Logged In: YES
user_id=1326842
Originator: NO
This should be fixed with r52974 and r52975:
http://svn.python.org/view?view=rev&rev=52974
I can't test it on Windows, so someone else
should close this bug if it is fixed.
--
Comment By: Martin v. Löwis (loewis)
Date: 2006-11-30 21:59
Message:
Logged In: YES
user_id=21627
Originator: NO
pekon, it would be quite helpful if you could resolve this. It would be
best if you could check out the subversion trunk or release25-maint branch,
and then provide a patch that solves it all :-)
After applying your (correct) patch, I still get such an error, so I guess
there are more problems in the tex source.
--
Comment By: Petr Konecny (pekon)
Date: 2006-11-30 21:55
Message:
Logged In: YES
user_id=828085
Originator: NO
After changing libmsilib.tex I made some manual fixes in python-lib.texi
and was able to get .info files. I am attaching diff, which shows what is
broken.
--- python-lib.texi 2006-11-30 12:54:04.626177825 -0800
+++ python-lib.texi.fixed 2006-11-30 12:53:28.767367718 -0800
@@ -30395,7 +30395,7 @@
QName wrapper. This can be used to wrap a QName attribute value, in
order to get proper namespace handling on output.
@var{text_or_uri} is a string containing the QName value,
-in the form @[EMAIL PROTECTED]@[EMAIL PROTECTED], or, if the tag argument is
given,
+in the form @[EMAIL PROTECTED], or, if the tag argument is given,
the URI part of a QName.
If @var{tag} is given, the first argument is interpreted as
an URI, and this argument is interpreted as a local name.
@@ -49305,8 +49305,6 @@
@findex EDQUOT
Quota exceeded @end table
[EMAIL PROTECTED]@[EMAIL PROTECTED] ifinfo
[EMAIL PROTECTED]@[EMAIL PROTECTED]@}
@node ctypes, , errno, Generic Operating System Services
@section A foreign function library for Python.
@@ -51073,12 +51071,14 @@
Here is the wrapping with @code{ctypes}:
[EMAIL PROTECTED]>>> from ctypes import c_int, WINFUNCTYPE, windll
[EMAIL PROTECTED]
+>>> from ctypes import c_int, WINFUNCTYPE, windll
>>> from ctypes.wintypes import HWND, LPCSTR, UINT
>>> prototype = WINFUNCTYPE(c_int, HWND, LPCSTR, LPCSTR, c_uint)
>>> paramflags = (1, "hwnd", 0), (1, "text", "Hi"), (1, "caption", None),
(1, "flags", 0)
>>> MessageBox = prototype(("MessageBoxA", windll.user32), paramflags)
->>>@end example
+>>>
[EMAIL PROTECTED] example
The MessageBox foreign function can now be called in these ways:
@example
@@ -51101,12 +51101,14 @@
Here is the wrapping with @code{ctypes}:
[EMAIL PROTECTED]>>> from ctypes import POINTER, WINFUNCTYPE, windll
[EMAIL PROTECTED]
+>>> from ctypes import POINTER, WINFUNCTYPE, windll
>>> from ctypes.wintypes import BOOL, HWND, RECT
>>> prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))
>>> paramflags = (1, "hwnd"), (2, "lprect")
>>> GetWindowRect = prototype(("GetWindowRect", windll.user32),
paramflags)
->>>@end example
+>>>
[EMAIL PROTECTED] example
Functions with output parameters will automatically return the output
parameter value if there is a single one, or a tuple containing the
@@ -59352,7 +59354,8 @@
.
Example usage:
[EMAIL PROTECTED] wsgiref.simple_server import make_server, demo_app
[EMAIL PROTECTED]
+from wsgiref.simple_server import make_server, demo_app
httpd = make_server('', 8000, demo_app)
print "Serving HTTP on port 8000..."
--
Comment By: Petr Konecny (pekon)
Date: 2006-11-30 21:42
Message:
Logged In: YES
user_id=828085
Originator: NO
I believe this problem is triggered by a typo in lib/libmsilib.tex:347
\begin{classdesc}{Feature}{database, id, title, desc, display\optional{,
level=1\optional{, parent\optional\{, directory\optional{,
attributes=0
I think it should look like this:
\begin{classdesc}{Fe
[ python-Bugs-1568429 ] broken info files generation
Bugs item #1568429, was opened at 2006-09-30 20:49
Message generated for change (Comment added) made by zseil
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1568429&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
>Status: Closed
>Resolution: Duplicate
Priority: 5
Private: No
Submitted By: Arkadiusz Miskiewicz (arekm)
Assigned to: Nobody/Anonymous (nobody)
Summary: broken info files generation
Initial Comment:
Hi,
Currently make -C Doc/info will not work. There are bugs
in *.tex files which prevent py2texinfo from working.
Also even after fixing these there are some weird
constructs which later make makeinfo go mad.
Take a look at
http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/python-
info.patch
which has some fixes for that.
This one is important:
-level=1\optional{, parent\optional\{,
directory\optional{,
-attributes=0
+level=1\optional{, parent\optional{,
directory\optional{,
+attributes=0}
- unmatched {} + one wrongly quoted {
The other thing is using quote enviroment which is
unknown to py2texinfo - change it to quotation.
--
>Comment By: Žiga Seilnacht (zseil)
Date: 2007-03-24 17:40
Message:
Logged In: YES
user_id=1326842
Originator: NO
This is a duplicate of bug #1595164:
http://www.python.org/sf/1595164
--
Comment By: Martin v. Löwis (loewis)
Date: 2006-10-02 17:06
Message:
Logged In: YES
user_id=21627
Can you please attach your proposed change as an "svn diff"
for the version you are referring to?
--
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1568429&group_id=5470
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1647489 ] zero-length match confuses re.finditer()
Bugs item #1647489, was opened at 2007-01-29 22:35
Message generated for change (Settings changed) made by gbrandl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1647489&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Regular Expressions
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jacques Frechet (jfrechet)
>Assigned to: Nobody/Anonymous (nobody)
Summary: zero-length match confuses re.finditer()
Initial Comment:
Hi!
re.finditer() seems to incorrectly increment the current position immediately
after matching a zero-length substring. For example:
>>> [m.groups() for m in re.finditer(r'(^z*)|(\w+)', 'abc')]
[('', None), (None, 'bc')]
What happened to the 'a'? I expected this result:
[('', None), (None, 'abc')]
Perl agrees with me:
% perl -le 'print defined($1)?"\"$1\"":"undef",",",defined($2)?"\"$2\"":"undef"
while "abc" =~ /(z*)|(\w+)/g'
"",undef
undef,"abc"
"",undef
Similarly, if I remove the ^:
>>> [m.groups() for m in re.finditer(r'(z*)|(\w+)', 'abc')]
[('', None), ('', None), ('', None), ('', None)]
Now all of the letters have fallen through the cracks! I expected this result:
[('', None), (None, 'abc'), ('', None)]
Again, perl agrees:
% perl -le 'print defined($1)?"\"$1\"":"undef",",",defined($2)?"\"$2\"":"undef"
while "abc" =~ /(z*)|(\w+)/g'
"",undef
undef,"abc"
"",undef
If this bug has already been reported, I apologize -- I wasn't able to find it
here. I haven't looked at the code for the re module, but this seems like the
sort of bug that might have been accidentally introduced in order to try to
prevent the same zero-length match from being returned forever.
Thanks,
Jacques
--
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1647489&group_id=5470
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1666318 ] shutil.copytree doesn't preserve directory permissions
Bugs item #1666318, was opened at 2007-02-22 17:26 Message generated for change (Comment added) made by thomaswaldmann You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1666318&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jeff McNeil (j_mcneil) Assigned to: Nobody/Anonymous (nobody) Summary: shutil.copytree doesn't preserve directory permissions Initial Comment: I am using shutil.copytree to setup new user home directories within an automated system. The copy2 function is called in order to copy individual files and preserve stat data. However, copytree simply calls os.mkdir and leaves directory creation at the mercy of my current umask (in my case, that's daemon context - 0). I've got to then iterate through the newly copied tree and set permissions on each individual subdirectory. Adding a simple copystat(src, dst) on line 112 of shutil.py fixes the problem. The result should be uniform; either preserve permissions across the board, or leave it to the mercy of the caller. I know there's an enhancement request already open to supply a 'func=' kw argument to copytree. -- Comment By: Thomas Waldmann (thomaswaldmann) Date: 2007-03-24 19:07 Message: Logged In: YES user_id=100649 Originator: NO I can confirm this bug. For MoinMoin wiki, we solved that by duplicating this function to our own tree and we did exactly the proposed change: Adding a simple copystat(src, dst) on line 112 of shutil.py (right below os.mkdir) fixes this problem. I also suggest to remove that XXX comment in that function. With the proposed fix, it gets usable and thus is not only example code any more. BUT: for avoiding problems on win32, a second fix needs to be done. For MoinMoin, we call this wrapper around shutil.copystat from our copytree function: def copystat(src, dst): """Copy stat bits from src to dst This should be used when shutil.copystat would be used on directories on win32 because win32 does not support utime() for directories. According to the official docs written by Microsoft, it returns ENOACCES if the supplied filename is a directory. Looks like a trainee implemented the function. """ if sys.platform == 'win32' and S_ISDIR(os.stat(dst)[ST_MODE]): if os.name == 'nt': st = os.stat(src) mode = S_IMODE(st[ST_MODE]) if hasattr(os, 'chmod'): os.chmod(dst, mode) # KEEP THIS ONE! #else: pass # we are on Win9x,ME - no chmod here else: shutil.copystat(src, dst) As you see, some special treatment is needed for win32/nt and directories - and directories are exactly the use case used by the fixed copytree, so a fixed copystat is needed or copytree will crash on win32/nt. -- Comment By: Jeff McNeil (j_mcneil) Date: 2007-02-22 17:28 Message: Logged In: YES user_id=1726175 Originator: YES python -V Python 2.4.3 on Linux marvin 2.6.18-1.2257.fc5smp #1 SMP Fri Dec 15 16:33:51 EST 2006 i686 i686 i386 GNU/Linux -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1666318&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1595164 ] texinfo library documentation fails to build
Bugs item #1595164, was opened at 2006-11-12 20:15
Message generated for change (Comment added) made by loewis
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1595164&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Mark Diekhans (diekhans)
Assigned to: Nobody/Anonymous (nobody)
Summary: texinfo library documentation fails to build
Initial Comment:
Attempting to build the texinfo documentation generates
the error (args-out-of-range 2931944 2931946).
This occurs in download of 2.5 latex doc and from trunk
of svn tree.
elisp stack trace attached.
It would be really nice if texinfo doc was still
available for download.
--
>Comment By: Martin v. Löwis (loewis)
Date: 2007-03-24 19:25
Message:
Logged In: YES
user_id=21627
Originator: NO
There is no need that the documentation builds on Windows, so closing this
as fixed. zseil, thanks for looking into it.
--
Comment By: Žiga Seilnacht (zseil)
Date: 2007-03-24 17:38
Message:
Logged In: YES
user_id=1326842
Originator: NO
This should be fixed with r52974 and r52975:
http://svn.python.org/view?view=rev&rev=52974
I can't test it on Windows, so someone else
should close this bug if it is fixed.
--
Comment By: Martin v. Löwis (loewis)
Date: 2006-11-30 21:59
Message:
Logged In: YES
user_id=21627
Originator: NO
pekon, it would be quite helpful if you could resolve this. It would be
best if you could check out the subversion trunk or release25-maint branch,
and then provide a patch that solves it all :-)
After applying your (correct) patch, I still get such an error, so I guess
there are more problems in the tex source.
--
Comment By: Petr Konecny (pekon)
Date: 2006-11-30 21:55
Message:
Logged In: YES
user_id=828085
Originator: NO
After changing libmsilib.tex I made some manual fixes in python-lib.texi
and was able to get .info files. I am attaching diff, which shows what is
broken.
--- python-lib.texi 2006-11-30 12:54:04.626177825 -0800
+++ python-lib.texi.fixed 2006-11-30 12:53:28.767367718 -0800
@@ -30395,7 +30395,7 @@
QName wrapper. This can be used to wrap a QName attribute value, in
order to get proper namespace handling on output.
@var{text_or_uri} is a string containing the QName value,
-in the form @[EMAIL PROTECTED]@[EMAIL PROTECTED], or, if the tag argument is
given,
+in the form @[EMAIL PROTECTED], or, if the tag argument is given,
the URI part of a QName.
If @var{tag} is given, the first argument is interpreted as
an URI, and this argument is interpreted as a local name.
@@ -49305,8 +49305,6 @@
@findex EDQUOT
Quota exceeded @end table
[EMAIL PROTECTED]@[EMAIL PROTECTED] ifinfo
[EMAIL PROTECTED]@[EMAIL PROTECTED]@}
@node ctypes, , errno, Generic Operating System Services
@section A foreign function library for Python.
@@ -51073,12 +51071,14 @@
Here is the wrapping with @code{ctypes}:
[EMAIL PROTECTED]>>> from ctypes import c_int, WINFUNCTYPE, windll
[EMAIL PROTECTED]
+>>> from ctypes import c_int, WINFUNCTYPE, windll
>>> from ctypes.wintypes import HWND, LPCSTR, UINT
>>> prototype = WINFUNCTYPE(c_int, HWND, LPCSTR, LPCSTR, c_uint)
>>> paramflags = (1, "hwnd", 0), (1, "text", "Hi"), (1, "caption", None),
(1, "flags", 0)
>>> MessageBox = prototype(("MessageBoxA", windll.user32), paramflags)
->>>@end example
+>>>
[EMAIL PROTECTED] example
The MessageBox foreign function can now be called in these ways:
@example
@@ -51101,12 +51101,14 @@
Here is the wrapping with @code{ctypes}:
[EMAIL PROTECTED]>>> from ctypes import POINTER, WINFUNCTYPE, windll
[EMAIL PROTECTED]
+>>> from ctypes import POINTER, WINFUNCTYPE, windll
>>> from ctypes.wintypes import BOOL, HWND, RECT
>>> prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))
>>> paramflags = (1, "hwnd"), (2, "lprect")
>>> GetWindowRect = prototype(("GetWindowRect", windll.user32),
paramflags)
->>>@end example
+>>>
[EMAIL PROTECTED] example
Functions with output parameters will automatically return the output
parameter value if there is a single one, or a tuple containing the
@@ -59352,7 +59354,8 @@
.
Example usage:
[EMAIL PROTECTED] wsgiref.simple_server import make_server, demo_app
[EMAIL PROTECTED]
+from wsgiref.simple_server import make_server, demo_app
httpd = make_server('', 8000, demo_app)
print "Serving HTTP on port 8000..."
--
Comment By: Petr Konecny (pekon)
Date: 2006-11-30 21:42
Message:
Logged In: YES
u
[ python-Bugs-1438480 ] shutil.move raises OSError when copystat fails
Bugs item #1438480, was opened at 2006-02-25 06:26 Message generated for change (Comment added) made by thomaswaldmann You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1438480&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Joe Wreschnig (piman) Assigned to: Nobody/Anonymous (nobody) Summary: shutil.move raises OSError when copystat fails Initial Comment: If you are on a Linux system, and shutil.move a file from anywhere onto a partition where you have write permission but are not the owner, os.utime will fail with an EPERM OSError. This can (and did) happen moving a file on a vfat partition mounted with umask=, so every user had read/write/execute but all files were owned by root. This happens in shutil.copystat, so shutil.move doesn't remove the old file. The resulting error code (OSError, EPERM) is not distinguishable from several other permission errors that can happen during shutil.move, even though a failure to set a utime is not fatal for most move operations (mv(1) succeeds, for example). I would suggest either ignoring an EPERM from copystat, or catching it in shutil.copy2 and raising a more specific exception so that it can be easily distinguished from genuine failure due to permissions. -- Comment By: Thomas Waldmann (thomaswaldmann) Date: 2007-03-24 19:51 Message: Logged In: YES user_id=100649 Originator: NO See also http://sourceforge.net/tracker/index.php?func=detail&aid=1666318&group_id=5470&atid=105470 for a similar problem with copystat. -- Comment By: Joe Wreschnig (piman) Date: 2006-02-26 06:08 Message: Logged In: YES user_id=796 The attached patch causes shutil.copy and shutil.copy2 (and so copytree, and move) to ignore EACCES and EPERM from copymode and copystat respectively. Other errors are reraised with the original traceback. Any error copying the file, rather than the metadata, is still considered fatal. User calls to copymode and copystat still fail as before. Justification: On Linux, utime(2) says the distinction between EACCES and EPERM is blurry and "Linux is not careful to distinguish between the EACCES and EPERM" so the patch ignores both. In my opinion, anyone wanting to deal with low-level details like mtimes and modes is probably not using shutil, so ignoring is better than a new exception (which would just result in complicated new code, and surprise old code). It's also easy for a caller to check if the mode/utimes were copied, if it's important to them. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1438480&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[ python-Bugs-1145257 ] shutil.copystat() may fail...
Bugs item #1145257, was opened at 2005-02-21 10:02 Message generated for change (Comment added) made by thomaswaldmann You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1145257&group_id=5470 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Petr Prikryl (prikryl) Assigned to: Nobody/Anonymous (nobody) Summary: shutil.copystat() may fail... Initial Comment: Hi, The shutil.copystat() may fail in case when the destination file has read-only attribute. It's because the implementation calls the os.utime() first and os.chmod() later. In Windows (I am not sure if also in Unix-based system), the os.utime() fails for read-only files. The implementation should ensure the read/write access by " try: os.chmod(dst, 0600)..." before calling the os.utime(). The file mode will be copied from the source file in the next step anyway. The simplistic test attached (Unix line ending used inside the tst.py zipped inside). Petr -- Comment By: Thomas Waldmann (thomaswaldmann) Date: 2007-03-24 20:06 Message: Logged In: YES user_id=100649 Originator: NO See http://sourceforge.net/tracker/index.php?func=detail&aid=1666318&group_id=5470&atid=105470 for another problem with utime() on win32/nt with directories. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1145257&group_id=5470 ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
