[issue17696] lookup fails for renamed functions

2013-04-11 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt: When you rename a test function, you can't explicitly specify it on the commandline any more. During normal test runs, it is automatically discovered though. The error is that the old name was not found, even though the new name was specified. The att

[issue11470] Flag inappropriate uses of callable class attributes

2013-02-25 Thread Ulrich Eckhardt
Changes by Ulrich Eckhardt : -- nosy: +eckhardt ___ Python tracker <http://bugs.python.org/issue11470> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4331] Can't use _functools.partial() created function as method

2013-02-25 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: There is at least one thing that is missing in the patch, it lacks the necessary tests. The partialbug.py demonstrates the issue, it could be used as a base. However, even then, there is still one thing that is problematic: The fact that partial() returns

[issue4331] Can't use _functools.partial() created function as method

2013-02-07 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Just for the record, the behaviour is documented, unfortunately in the very last line of the functools documentation: "Also, partial objects defined in classes behave like static methods and do not transform into bound methods during instance attribute

[issue12459] time.sleep(-1.0) behaviour

2011-06-30 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : For reference, see the thread on the users' mailinglist/newsgroup from 2011-06-29 "how to call a function for evry 10 seconds" and the thread on the developers' mailinglist from 2011-06-30 "time.sleep(-1) behaviour". The pro

[issue5117] os.path.relpath problem with root directory

2010-09-29 Thread Ulrich Eckhardt
Changes by Ulrich Eckhardt : -- nosy: +eckhardt ___ Python tracker <http://bugs.python.org/issue5117> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1669539] Change (fix!) os.path.isabs() semantics on Win32

2010-09-29 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: I just stumbled across the issue with isabs(). I'd also say that Mark Hammond already provided the typical use case for this, i.e. that you allow relative paths for convenience when storing them or putting them on the commandline, but for actual us

[issue1669539] Change (fix!) os.path.isabs() semantics on Win32

2010-09-29 Thread Ulrich Eckhardt
Changes by Ulrich Eckhardt : -- nosy: +eckhardt ___ Python tracker <http://bugs.python.org/issue1669539> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4829] confusing error for file("foo", "w++")

2009-06-02 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Good catch, it just took me a while to actually figure out myself where the bug is. Try the following instead: import io io.FileIO('foo.text', 'w++') This will yield "ValueError: Must have exactly one of read/write/append m

[issue5134] Compiler warnings in sqlite module

2009-02-09 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: "What specific file would you put these pragmas into? Are you perhaps proposing to change upstream code?" I would put it into the only sourcefile there is, and yes, I would change upstream code. Obviously, it would be better to get upstream to i

[issue5134] Compiler warnings in sqlite module

2009-02-06 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Technically, both changes (or neither of them) generate the same output binaries, so I Don't Care(tm). My approach for disabling the warnings in the code has (to me) two advantages: 1. You immediately see that warnings are disabled. I would otherwise

[issue5134] Compiler warnings in sqlite module

2009-02-03 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: The syntax would be this: #if defined(_MSC_VER) # pragma warning(push) /* Disable warnings for this file, see http://www.sqlite.org/faq.html#q17 why we don't care for them. */ # pragma warning(disable: 4244) # pragma warning(disable: 4018) #

[issue5056] PyAPI assumes OS can access shared data in loadable modules (windows can't)

2009-01-29 Thread Ulrich Eckhardt
Changes by Ulrich Eckhardt : -- nosy: +eckhardt ___ Python tracker <http://bugs.python.org/issue5056> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1754] WindowsError messages are not properly encoded

2009-01-27 Thread Ulrich Eckhardt
Changes by Ulrich Eckhardt : -- nosy: +eckhardt ___ Python tracker <http://bugs.python.org/issue1754> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5078] Avoid redundant call to FormatError()

2009-01-27 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : For a background, see the developers' mailing list from 2009-01-26, subject "FormatError() in callproc.c under win32". The attached patch removes the redundant call to FormatError(). It also makes SetException() a static function, since

[issue4949] Constness in PyErr_NewException

2009-01-14 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: It's not just that function, at least not in trunk. There are also PyErr_SetFromErrnoWithFilename, PyErr_SetFromErrnoWithUnicodeFilename and _PyErr_BadInternalCall which should be made const correct, see attached patch for trunk. This patch also fixes

[issue4944] os.fsync() doesn't work as expect in Windows

2009-01-13 Thread Ulrich Eckhardt
Changes by Ulrich Eckhardt : -- nosy: +eckhardt ___ Python tracker <http://bugs.python.org/issue4944> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4915] Port sysmodule.c to MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Next attempt, exclude all win variants from check. Added file: http://bugs.python.org/file12690/python-2.7-wince-sysmodule.2.patch ___ Python tracker <http://bugs.python.org/issue4

[issue4915] Port sysmodule.c to MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: The CE documentation mentions directories, too, but is silent on the FILE_FLAG_BACKUP_SEMANTICS use for them. Also, even using that flag, I can't open a directory under CE. It seems that this check is superfluous there. I can also confirm that you g

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: > That's all fine, but why do you need a variable named "e" in > the first place? Can't you leave the code as it was before?" There is an intermediate call to a function that retrieves the thread's ID. That function

[issue4915] Port sysmodule.c to MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Changed patch with curly brackets outside the conditional code. Added file: http://bugs.python.org/file12689/python-2.7-wince-sysmodule.1.patch ___ Python tracker <http://bugs.python.org/issue4

[issue4915] Port sysmodule.c to MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: I don't really know what happens when you try to read()/fread() from stdin that is a directory, but I guess it will fail quickly even without an explicit check by Python. A directory can be opened under win32 just like a file, so I guess that you could

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Actually, I made the distinction between the 'int e' and the 'unsigned e' consciously. When using 'errno', using an 'int' is correct. When using GetLastError(), I would have used a win32 DWORD if there was a for

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Okay, hopefully this patch is final. The last one was using 'errno' in debug mode, but under CE using CreateThread() it should use GetLastError(). I also took the liberty of saving that error information for both variants directly after creating

[issue4915] Port sysmodule.c to MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : The attached patch is for sysmodule.c, it contains two changes: 1. The check whether stdin is a directory is rewritten without using fstat(), which doesn't exist under CE. 2. Replacing sys.argv[0] with the full path is skipped, CE doesn't have

[issue4893] Use separate thread support code under MS Windows CE

2009-01-11 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Okay, the changes necessary to the NT thread code are rather minimal, see attached patch. The file thread_wince.c could then be removed, too. I also removed a comment which was left over from the version before but doesn't apply any more. Added file:

[issue4905] Use INVALID_FILE_ATTRIBUTES instead of magic numbers

2009-01-10 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: The patch replaces remaining magic numbers with INVALID_FILE_ATTRIBUTES. -- keywords: +patch Added file: http://bugs.python.org/file12673/python-2.7-fileattrib-magic.0.patch ___ Python tracker <h

[issue4905] Use INVALID_FILE_ATTRIBUTES instead of magic numbers

2009-01-10 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : GetFileAttributes[W|A] returns a DWORD with this value when it couldn't determine the file's attributes. In the Python codebase, there are basically three values this is compared with, the above macro, 0x and (DWORD)-1, it should only be

[issue4893] Use separate thread support code under MS Windows CE

2009-01-10 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: The thread code is unaffected by the Unicode/ANSI issues, but CE doesn't have _beginthread[ex], which are mandatory for the desktop variants. I have checkin 68455 and I will try to compile the new NT code under CE to estimate how large the change

[issue4900] Can't Locate File with No Capital in Name

2009-01-09 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: "\t" is a tab while "\T" is (I think) just an ugly equivalent to "T". Use either of r"D:\test.html" "D:\\test.html" Please check if that is the reason for your failure. -- nosy: +eckhardt

[issue4895] Missing strdup() under MS Windows CE

2009-01-09 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : CE6 doesn't provide strdup() but provides an equivalent _strdup() in stdlib.h. The attached patch simply #defines strdup _strdup after including said header file. -- components: Interpreter Core files: python-2.7-wince-strdup.0.patch keywords:

[issue4893] Use separate thread support code under MS Windows CE

2009-01-09 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : There is a separate file thread_wince.h for use with CE, but that is firstly not used due to a missing macro definition and secondly it doesn't compile as it is. The attached patch defines WINCE_THREADS for CE and makes the file at least compile. Note

[issue4841] io's close() not handling errors correctly

2009-01-07 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: >> 4. I wonder if internal_close() should reset only the 'fd' field >> or if it should also reset 'readable', 'writable', 'seekable' > > seekable(), readable() and writable() raise an error if the

[issue4856] Remove checks for win NT

2009-01-06 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: This patch removes all calls to win32's GetVersion() where they are used to detect NT. In posixmodule.c it was used by a wrapper function that cached the result, which then also became obsolete. -- keywords: +patch Added file: http://bugs.pytho

[issue3582] thread_nt.c update

2009-01-06 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: You're right, Kristján, sorry for the noise. Shouldn't make claims before being fully awake ___ Python tracker <http://bugs.python.

[issue4856] Remove checks for win NT

2009-01-06 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : There are several checks like "GetVersion() < 0x8000" that try to determine whether there is support for the WCHAR versions of the win32 API. Since all support for MS Windows 95, 98 and ME has been dropped, all supported systems suppo

[issue3582] thread_nt.c update

2009-01-06 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: I do have an issue with the patch's startup code. The prototype for the thread entry should be "DWORD WINAPI function(PVOID);". The important distinction is the WINAPI part, which resolves to __stdcall but doesn't have to. I know

[issue4846] Py_UNICODE_ISSPACE causes linker error

2009-01-05 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Actually, providing the patch for PyAPI_Data/PyAPI_Func wouldn't be so hard, but there are lots of headers that need to be changed, i.e. all their existing extern "C" clauses removed. What I would do is build the Python shared library as it

[issue3582] thread_nt.c update

2009-01-05 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: No, CreateThread() is not a suitable replacement, because it lacks some initialisations of the C library, as explained in the MSDN: http://msdn.microsoft.com/en-us/library/ms682453(VS.85).aspx -- nosy: +eckhardt

[issue4846] Py_UNICODE_ISSPACE causes linker error

2009-01-05 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: You beat me by 10 minutes, Alexander, otherwise I'd have had a similar patch, except moving the declaration. I agree with your rationale though, so yours is even better. Concerning including the extern "C" in the PyAPI_* macros, I had the same

[issue4841] io's close() not handling errors correctly

2009-01-05 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: I have a patch here which passes the proposed change to the tests in trunk. A few notes up front though, since the patch isn't good yet: 1. The handling of the error in internal_close() isn't really good. What I'm also not sure about is whethe

[issue4841] io's close() not handling errors correctly

2009-01-05 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: This adds a test that the close() correctly fails with an IOError. -- keywords: +patch Added file: http://bugs.python.org/file12593/python-2.7-fileio-close-test.0.patch ___ Python tracker <http://bugs.python.

[issue4841] io's close() not handling errors correctly

2009-01-05 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : In _fileio.c, there is the following comment: "Returns 0 on success, errno (which is < 0) on failure." The problem here is the claim that errno ever was less than zero, which is simply wrong. You can see this being a problem with the follow

[issue4829] confusing error for file("foo", "w++")

2009-01-04 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : Specifying the '+' more than once while opening a file results in the error "Must have exactly one of read/write/append mode". The attached patch extends that with ".. and at most one optional plus". Further, the patch ch

[issue4817] PyOS_GetLastModificationTime is unused

2009-01-03 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : This is just to record that the above function is wrongly documented, inconsistently implemented, but fortunately unused, so it can be removed. In addition to the patch attached, there are two files that can be removed: Python/getmtime.c RISCOS/Python

[issue1699259] replacing char* with const char* in sysmodule.c/.h

2009-01-02 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Concerning the SetArgv( int, char**), that one will have to be changed to a SetArgv( int, char const* const*), i.e. applying the const on both levels. Otherwise, there is no implicit conversion between the two. The reason is a bit complicated: if the function

[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2009-01-02 Thread Ulrich Eckhardt
Changes by Ulrich Eckhardt : -- nosy: +eckhardt ___ Python tracker <http://bugs.python.org/issue4681> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4807] wrong wsprintf usage

2009-01-02 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt : Note up front: there is a win32 function wsprintf() and an ISO C function swprintf(), these are different things in case you wonder. In _winreg.c, there are two functions that use wsprintf on a char buffer, while the function takes a TCHAR buffer instead

[issue4075] Use WCHAR variant of OutputDebugString

2008-10-14 Thread Ulrich Eckhardt
Ulrich Eckhardt <[EMAIL PROTECTED]> added the comment: "If this patch required for CE 5.0?" The patch I created is required for all CEs that I know of. I have personally worked with 4.20, 5 and now 6, and had some exchange with others who worked on 3.x variants to get STLport

[issue4098] surprised by default list parameter

2008-10-10 Thread Ulrich Eckhardt
Ulrich Eckhardt <[EMAIL PROTECTED]> added the comment: http://effbot.org/pyfaq/why-are-default-values-shared-between-objects.htm The same recently cropped up on the users mailinglist under the topic "default value in __init__". --

[issue4075] Use WCHAR variant of OutputDebugString

2008-10-10 Thread Ulrich Eckhardt
Ulrich Eckhardt <[EMAIL PROTECTED]> added the comment: "PythonCE project use xxxA functions for CE .NET 4.20 platform." Look again. The PythonCE project adds a header and sourcefile (wince_compatibility.h/c) which adds these functions. In other words, it doesn't use the

[issue4075] Use WCHAR variant of OutputDebugString

2008-10-09 Thread Ulrich Eckhardt
Ulrich Eckhardt <[EMAIL PROTECTED]> added the comment: Actually, even _Py_NegativeRefcount() passes a statically sized buffer with 300 chars. Other than that, there is get_ref_type() which uses one with 350 chars, but AFAICT, that's the largest one. Attached accordingly mod

[issue4075] Use WCHAR variant of OutputDebugString

2008-10-09 Thread Ulrich Eckhardt
Ulrich Eckhardt <[EMAIL PROTECTED]> added the comment: Roumen, just and explanation on the TCHAR/WCHAR/CHAR issue under win32... In the old days, DOS/Windows was built with 8-bit characters using codepages. So functions like CreateFile() took a char string that used the current local co

[issue4077] Py_FatalError cleanup patch

2008-10-08 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt <[EMAIL PROTECTED]>: This patch does two things: * It removes trailing newlines from the arguments given to Py_FatalError() because a trailing newline is already added automatically. * It fixes the declaration in ffi.c to take a '

[issue4075] Use WCHAR variant of OutputDebugString

2008-10-08 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt <[EMAIL PROTECTED]>: The attached patch converts the call to OutputDebugString() with a 'TCHAR' parameter (which boils down to a 'char') to one using a 'WCHAR' parameter, allowing the code to be compiled under MS Wind

[issue4051] use of TCHAR under win32

2008-10-06 Thread Ulrich Eckhardt
Ulrich Eckhardt <[EMAIL PROTECTED]> added the comment: Add a patch that fixes a warning. -- keywords: +patch Added file: http://bugs.python.org/file11708/Python-unicode-redefine-warning.0.patch ___ Python tracker <[EMAIL PROTECTE

[issue4051] use of TCHAR under win32

2008-10-06 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt <[EMAIL PROTECTED]>: In several places, Python is using TCHAR-based win32 APIs which has several consequences: 1. The actually used function depends on the _UNICODE macro, while the using code often assumes that this macro is not defined. That means