pywin32-bugs Mailing List for Python for Windows Extensions (Page 70)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(24) |
May
(19) |
Jun
(15) |
Jul
(43) |
Aug
(39) |
Sep
(25) |
Oct
(43) |
Nov
(19) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(21) |
Feb
(18) |
Mar
(14) |
Apr
(80) |
May
(56) |
Jun
(24) |
Jul
(30) |
Aug
(17) |
Sep
(36) |
Oct
(106) |
Nov
(38) |
Dec
(30) |
2005 |
Jan
(14) |
Feb
(14) |
Mar
(48) |
Apr
(28) |
May
(49) |
Jun
(23) |
Jul
(9) |
Aug
(13) |
Sep
(28) |
Oct
(21) |
Nov
(8) |
Dec
(26) |
2006 |
Jan
(56) |
Feb
(33) |
Mar
(33) |
Apr
(18) |
May
(16) |
Jun
(9) |
Jul
(24) |
Aug
(16) |
Sep
(14) |
Oct
(37) |
Nov
(38) |
Dec
(22) |
2007 |
Jan
(7) |
Feb
(16) |
Mar
(11) |
Apr
(15) |
May
(15) |
Jun
(8) |
Jul
(24) |
Aug
(26) |
Sep
(18) |
Oct
(11) |
Nov
(20) |
Dec
(1) |
2008 |
Jan
(19) |
Feb
(55) |
Mar
(7) |
Apr
(35) |
May
(66) |
Jun
(38) |
Jul
(26) |
Aug
(5) |
Sep
(25) |
Oct
(25) |
Nov
(18) |
Dec
(18) |
2009 |
Jan
(25) |
Feb
(38) |
Mar
(29) |
Apr
(25) |
May
(5) |
Jun
(11) |
Jul
(16) |
Aug
(16) |
Sep
(16) |
Oct
(1) |
Nov
(15) |
Dec
(33) |
2010 |
Jan
(13) |
Feb
(11) |
Mar
(1) |
Apr
(24) |
May
(26) |
Jun
(19) |
Jul
(22) |
Aug
(51) |
Sep
(38) |
Oct
(39) |
Nov
(25) |
Dec
(27) |
2011 |
Jan
(40) |
Feb
(31) |
Mar
(21) |
Apr
(42) |
May
(11) |
Jun
(16) |
Jul
(20) |
Aug
(14) |
Sep
(6) |
Oct
(8) |
Nov
(34) |
Dec
(7) |
2012 |
Jan
(60) |
Feb
(24) |
Mar
(6) |
Apr
(28) |
May
(41) |
Jun
(15) |
Jul
(14) |
Aug
(25) |
Sep
(30) |
Oct
(18) |
Nov
(30) |
Dec
(9) |
2013 |
Jan
(3) |
Feb
(8) |
Mar
(17) |
Apr
(23) |
May
(34) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: SourceForge.net <no...@so...> - 2006-11-08 09:12:58
|
Bugs item #1590399, was opened at 2006-11-04 11:12 Message generated for change (Comment added) made by kxroberto You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 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: pythonwin Group: None Status: Open Resolution: None Priority: 9 Private: No Submitted By: kxroberto (kxroberto) Assigned to: Nobody/Anonymous (nobody) Summary: Refcounting in ui_assoc_object::GetGoodRet Initial Comment: I wonder if the below patch possibly addresses a refcount/memory problem. Think its possible, that DODECREF(this) frees <*this> from memory, another released threads malloc uses the memory and this->virtualInst is bogus? ( In preceding function ui_assoc_object::DoKillAssoc there is a simlar technique to do "PyObject *vi = virtualInst;" - but for reverse reason ) ( I'm still in search of memory leaks/crashes on dual cores and fast CPUs when other threads are going on parallel to win32ui GUI mainthread. ) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- >Comment By: kxroberto (kxroberto) Date: 2006-11-08 10:12 Message: Logged In: YES user_id=972995 Meanwhile there is significant feedback that c_GIL_bugs.patch in fact solved all the crash problems with threaded apps on all (dual core) machines. ---------------------------------------------------------------------- Comment By: kxroberto (kxroberto) Date: 2006-11-05 21:00 Message: Logged In: YES user_id=972995 In attachment a patch candidate I've so far in action for all these things. (That issue around "pExistingAppObject" was nonsense. pExistingAppObject seems to be not set to anything at all) Notes: The speed DECREF's in ~CVirtualHelper are switched all off by this patch - as it seems to not be valid so outside of the GIL. Would require a __asm LOCK INC/DEC or so. Have not seen serious speed issues in apps so far. Yet I've seen: most often CVirtualHelp is instanciated - costing a enter/leave python state switch - and then immediately a helper.call(..) with again a enter/leave state switch. If optimization necessary, possibly by a CVirtualHelpE does it which enters Python in constructor until destruction and the .call's do not again have to enter. Only few locations, where the intermediate PythonLeave/GUI_BGN_SAVE is necessary. ---------------------------------------------------------------------- Comment By: kxroberto (kxroberto) Date: 2006-11-04 16:49 Message: Logged In: YES user_id=972995 Think I found other serious potential refcount/GIL problems which cause crashes here in apps with threads - mainly on dual core - and set priority to 9: I looked over GUI_BGN_SAVE's => Py_XINC/DECREF's outside of the GIL. this causes probably the special problems only on dual cores when multiple threads: win32cmdui/Line120: GUI_BGN_SAVE; Python_delete_assoc(ob); GUI_END_SAVE; win32uimodule/Line650: void Python_delete_assoc( void *ob ) { // Notify Python object of my attached object removal. { CVirtualHelper helper ("OnAttachedObjectDeath", ob); <================ helper.call(); <================ } ui_assoc_object *pObj; if ((pObj=ui_assoc_object::GetPyObject(ob)) && !bInFatalShutdown) { CEnterLeavePython _celp; // KillAssoc requires it is held! pObj->KillAssoc(); } } win32virt.cpp/Line22 CVirtualHelper::CVirtualHelper(const char *iname, const void *iassoc, EnumVirtualErrorHandling veh/* = VEH_PRINT_ERROR */) { handler=NULL; py_ob = NULL; ... py_ob = py_bob; Py_INCREF(py_ob); <================ // Py_XINCREF(handler); } The gross hack for speed in CVirtualHelper::~CVirtualHelper() will not work for dual cores. A fast "ZDODECREF/ZDODECREF" independent of GIL (unless it went to 0) would be possible on x86 with "__asm LOCK DEC <(op)->ob_refcnt>" or so. see: http://groups.google.de/group/comp.lang.python/msg/ef530d4448814391 CVirtualHelper::~CVirtualHelper() { // XXX - Gross hack for speed. This is called for eachh window message // so only grabs the Python lock if the objects need Python, if ((retVal && retVal->ob_refcnt==1) || <================ DECREF not atomic on multi-core CPU's (handler && handler->ob_refcnt==1) || (py_ob && py_ob->ob_refcnt==1)) { CEnterLeavePython _celp; XDODECREF(retVal); XDODECREF(handler); XDODECREF(py_ob); } else { XDODECREF(retVal); <================ DECREF not atomic on multi-core CPU's XDODECREF(handler); XDODECREF(py_ob); } } Maybe there are other loose INCREFS / DECREFS in win32 code? And I found - probably most serious in this list - : Only CVirtualHelper::do_call is CEnterLeavePython protected: BOOL CVirtualHelper::do_call(PyObject *args) { CEnterLeavePython _celp; XDODECREF(retVal); // our old one. retVal = NULL; but all entrace call functions are not - but they are bulding up Python Values ! Think that is serious (even on single cores where I have very rare crashes): e.g.: BOOL CVirtualHelper::call() { if (!handler) return FALSE; PyObject *arglst = Py_BuildValue("()"); <================ return do_call(arglst); } =>Probably the CEnterleave protection should be moved out of do_call to all entrance call(...)'s & call_args() ? Looked in a rush over the 200 base DECREFs in Pythonwin. Found so far no other smelling refcounting. Only maybe this is invalid : --- win32app.cpp.orig 2006-01-10 15:38:00.000000000 +0100 +++ win32app.cpp 2006-11-04 16:44:24.009694400 +0100 @@ -412,6 +412,7 @@ { PyCWinThread::cleanup(); // total hack! - while (pExistingAppObject) + while (pExistingAppObject->ob_refcnt>1) DODECREF(pExistingAppObject); // this may delete it. + DODECREF(pExistingAppObject); } ---------------------------------------------------------------------- Comment By: kxroberto (kxroberto) Date: 2006-11-04 11:22 Message: Logged In: YES user_id=972995 (repeated) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-11-06 21:26:08
|
Bugs item #1591650, was opened at 2006-11-06 22:26 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1591650&group_id=78018 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: installation Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jan Bölsche (jan_boelsche) Assigned to: Nobody/Anonymous (nobody) Summary: setup.py quits while building win32inet_winhttp.cpp Initial Comment: setip.py seems to have trouble with a missing winhttp.h THis is a bug, right? Details below: Warning - can't find an installed platform SDK Found WINDOWS.H version 0x501 in C:\Program Files\Microsoft Visual Studio .NET 2 003\VC7\PlatformSDK\include building 'win32inet' extension skipping swig of win32/src/win32inet.i C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DDISTUTILS_BUILD -Icom/win32com/src/include -Iwin32/src - IC:\Python24\include -IC:\Python24\PC /Tpwin32/src/win32inet_winhttp.cpp /Fobuil d\temp.win32-2.4\Release\win32/src/win32inet_winhttp.obj win32inet_winhttp.cpp win32\src\win32inet_winhttp.cpp(10) : fatal error C1083: Cannot open include fil e: 'winhttp.h': No such file or directory error: command '"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.e xe"' failed with exit status 2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1591650&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-11-05 20:00:52
|
Bugs item #1590399, was opened at 2006-11-04 11:12 Message generated for change (Comment added) made by kxroberto You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 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: pythonwin Group: None Status: Open Resolution: None Priority: 9 Private: No Submitted By: kxroberto (kxroberto) Assigned to: Nobody/Anonymous (nobody) Summary: Refcounting in ui_assoc_object::GetGoodRet Initial Comment: I wonder if the below patch possibly addresses a refcount/memory problem. Think its possible, that DODECREF(this) frees <*this> from memory, another released threads malloc uses the memory and this->virtualInst is bogus? ( In preceding function ui_assoc_object::DoKillAssoc there is a simlar technique to do "PyObject *vi = virtualInst;" - but for reverse reason ) ( I'm still in search of memory leaks/crashes on dual cores and fast CPUs when other threads are going on parallel to win32ui GUI mainthread. ) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- >Comment By: kxroberto (kxroberto) Date: 2006-11-05 21:00 Message: Logged In: YES user_id=972995 In attachment a patch candidate I've so far in action for all these things. (That issue around "pExistingAppObject" was nonsense. pExistingAppObject seems to be not set to anything at all) Notes: The speed DECREF's in ~CVirtualHelper are switched all off by this patch - as it seems to not be valid so outside of the GIL. Would require a __asm LOCK INC/DEC or so. Have not seen serious speed issues in apps so far. Yet I've seen: most often CVirtualHelp is instanciated - costing a enter/leave python state switch - and then immediately a helper.call(..) with again a enter/leave state switch. If optimization necessary, possibly by a CVirtualHelpE does it which enters Python in constructor until destruction and the .call's do not again have to enter. Only few locations, where the intermediate PythonLeave/GUI_BGN_SAVE is necessary. ---------------------------------------------------------------------- Comment By: kxroberto (kxroberto) Date: 2006-11-04 16:49 Message: Logged In: YES user_id=972995 Think I found other serious potential refcount/GIL problems which cause crashes here in apps with threads - mainly on dual core - and set priority to 9: I looked over GUI_BGN_SAVE's => Py_XINC/DECREF's outside of the GIL. this causes probably the special problems only on dual cores when multiple threads: win32cmdui/Line120: GUI_BGN_SAVE; Python_delete_assoc(ob); GUI_END_SAVE; win32uimodule/Line650: void Python_delete_assoc( void *ob ) { // Notify Python object of my attached object removal. { CVirtualHelper helper ("OnAttachedObjectDeath", ob); <================ helper.call(); <================ } ui_assoc_object *pObj; if ((pObj=ui_assoc_object::GetPyObject(ob)) && !bInFatalShutdown) { CEnterLeavePython _celp; // KillAssoc requires it is held! pObj->KillAssoc(); } } win32virt.cpp/Line22 CVirtualHelper::CVirtualHelper(const char *iname, const void *iassoc, EnumVirtualErrorHandling veh/* = VEH_PRINT_ERROR */) { handler=NULL; py_ob = NULL; ... py_ob = py_bob; Py_INCREF(py_ob); <================ // Py_XINCREF(handler); } The gross hack for speed in CVirtualHelper::~CVirtualHelper() will not work for dual cores. A fast "ZDODECREF/ZDODECREF" independent of GIL (unless it went to 0) would be possible on x86 with "__asm LOCK DEC <(op)->ob_refcnt>" or so. see: http://groups.google.de/group/comp.lang.python/msg/ef530d4448814391 CVirtualHelper::~CVirtualHelper() { // XXX - Gross hack for speed. This is called for eachh window message // so only grabs the Python lock if the objects need Python, if ((retVal && retVal->ob_refcnt==1) || <================ DECREF not atomic on multi-core CPU's (handler && handler->ob_refcnt==1) || (py_ob && py_ob->ob_refcnt==1)) { CEnterLeavePython _celp; XDODECREF(retVal); XDODECREF(handler); XDODECREF(py_ob); } else { XDODECREF(retVal); <================ DECREF not atomic on multi-core CPU's XDODECREF(handler); XDODECREF(py_ob); } } Maybe there are other loose INCREFS / DECREFS in win32 code? And I found - probably most serious in this list - : Only CVirtualHelper::do_call is CEnterLeavePython protected: BOOL CVirtualHelper::do_call(PyObject *args) { CEnterLeavePython _celp; XDODECREF(retVal); // our old one. retVal = NULL; but all entrace call functions are not - but they are bulding up Python Values ! Think that is serious (even on single cores where I have very rare crashes): e.g.: BOOL CVirtualHelper::call() { if (!handler) return FALSE; PyObject *arglst = Py_BuildValue("()"); <================ return do_call(arglst); } =>Probably the CEnterleave protection should be moved out of do_call to all entrance call(...)'s & call_args() ? Looked in a rush over the 200 base DECREFs in Pythonwin. Found so far no other smelling refcounting. Only maybe this is invalid : --- win32app.cpp.orig 2006-01-10 15:38:00.000000000 +0100 +++ win32app.cpp 2006-11-04 16:44:24.009694400 +0100 @@ -412,6 +412,7 @@ { PyCWinThread::cleanup(); // total hack! - while (pExistingAppObject) + while (pExistingAppObject->ob_refcnt>1) DODECREF(pExistingAppObject); // this may delete it. + DODECREF(pExistingAppObject); } ---------------------------------------------------------------------- Comment By: kxroberto (kxroberto) Date: 2006-11-04 11:22 Message: Logged In: YES user_id=972995 (repeated) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-11-04 15:49:51
|
Bugs item #1590399, was opened at 2006-11-04 11:12 Message generated for change (Comment added) made by kxroberto You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 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: pythonwin Group: None Status: Open Resolution: None >Priority: 9 Private: No Submitted By: kxroberto (kxroberto) Assigned to: Nobody/Anonymous (nobody) Summary: Refcounting in ui_assoc_object::GetGoodRet Initial Comment: I wonder if the below patch possibly addresses a refcount/memory problem. Think its possible, that DODECREF(this) frees <*this> from memory, another released threads malloc uses the memory and this->virtualInst is bogus? ( In preceding function ui_assoc_object::DoKillAssoc there is a simlar technique to do "PyObject *vi = virtualInst;" - but for reverse reason ) ( I'm still in search of memory leaks/crashes on dual cores and fast CPUs when other threads are going on parallel to win32ui GUI mainthread. ) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- >Comment By: kxroberto (kxroberto) Date: 2006-11-04 16:49 Message: Logged In: YES user_id=972995 Think I found other serious potential refcount/GIL problems which cause crashes here in apps with threads - mainly on dual core - and set priority to 9: I looked over GUI_BGN_SAVE's => Py_XINC/DECREF's outside of the GIL. this causes probably the special problems only on dual cores when multiple threads: win32cmdui/Line120: GUI_BGN_SAVE; Python_delete_assoc(ob); GUI_END_SAVE; win32uimodule/Line650: void Python_delete_assoc( void *ob ) { // Notify Python object of my attached object removal. { CVirtualHelper helper ("OnAttachedObjectDeath", ob); <================ helper.call(); <================ } ui_assoc_object *pObj; if ((pObj=ui_assoc_object::GetPyObject(ob)) && !bInFatalShutdown) { CEnterLeavePython _celp; // KillAssoc requires it is held! pObj->KillAssoc(); } } win32virt.cpp/Line22 CVirtualHelper::CVirtualHelper(const char *iname, const void *iassoc, EnumVirtualErrorHandling veh/* = VEH_PRINT_ERROR */) { handler=NULL; py_ob = NULL; ... py_ob = py_bob; Py_INCREF(py_ob); <================ // Py_XINCREF(handler); } The gross hack for speed in CVirtualHelper::~CVirtualHelper() will not work for dual cores. A fast "ZDODECREF/ZDODECREF" independent of GIL (unless it went to 0) would be possible on x86 with "__asm LOCK DEC <(op)->ob_refcnt>" or so. see: http://groups.google.de/group/comp.lang.python/msg/ef530d4448814391 CVirtualHelper::~CVirtualHelper() { // XXX - Gross hack for speed. This is called for eachh window message // so only grabs the Python lock if the objects need Python, if ((retVal && retVal->ob_refcnt==1) || <================ DECREF not atomic on multi-core CPU's (handler && handler->ob_refcnt==1) || (py_ob && py_ob->ob_refcnt==1)) { CEnterLeavePython _celp; XDODECREF(retVal); XDODECREF(handler); XDODECREF(py_ob); } else { XDODECREF(retVal); <================ DECREF not atomic on multi-core CPU's XDODECREF(handler); XDODECREF(py_ob); } } Maybe there are other loose INCREFS / DECREFS in win32 code? And I found - probably most serious in this list - : Only CVirtualHelper::do_call is CEnterLeavePython protected: BOOL CVirtualHelper::do_call(PyObject *args) { CEnterLeavePython _celp; XDODECREF(retVal); // our old one. retVal = NULL; but all entrace call functions are not - but they are bulding up Python Values ! Think that is serious (even on single cores where I have very rare crashes): e.g.: BOOL CVirtualHelper::call() { if (!handler) return FALSE; PyObject *arglst = Py_BuildValue("()"); <================ return do_call(arglst); } =>Probably the CEnterleave protection should be moved out of do_call to all entrance call(...)'s & call_args() ? Looked in a rush over the 200 base DECREFs in Pythonwin. Found so far no other smelling refcounting. Only maybe this is invalid : --- win32app.cpp.orig 2006-01-10 15:38:00.000000000 +0100 +++ win32app.cpp 2006-11-04 16:44:24.009694400 +0100 @@ -412,6 +412,7 @@ { PyCWinThread::cleanup(); // total hack! - while (pExistingAppObject) + while (pExistingAppObject->ob_refcnt>1) DODECREF(pExistingAppObject); // this may delete it. + DODECREF(pExistingAppObject); } ---------------------------------------------------------------------- Comment By: kxroberto (kxroberto) Date: 2006-11-04 11:22 Message: Logged In: YES user_id=972995 (repeated) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-11-04 10:22:26
|
Bugs item #1590399, was opened at 2006-11-04 11:12 Message generated for change (Comment added) made by kxroberto You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 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: pythonwin Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: kxroberto (kxroberto) Assigned to: Nobody/Anonymous (nobody) Summary: Refcounting in ui_assoc_object::GetGoodRet Initial Comment: I wonder if the below patch possibly addresses a refcount/memory problem. Think its possible, that DODECREF(this) frees <*this> from memory, another released threads malloc uses the memory and this->virtualInst is bogus? ( In preceding function ui_assoc_object::DoKillAssoc there is a simlar technique to do "PyObject *vi = virtualInst;" - but for reverse reason ) ( I'm still in search of memory leaks/crashes on dual cores and fast CPUs when other threads are going on parallel to win32ui GUI mainthread. ) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- >Comment By: kxroberto (kxroberto) Date: 2006-11-04 11:22 Message: Logged In: YES user_id=972995 (repeated) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-11-04 10:12:35
|
Bugs item #1590399, was opened at 2006-11-04 11:12 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 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: pythonwin Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: kxroberto (kxroberto) Assigned to: Nobody/Anonymous (nobody) Summary: Refcounting in ui_assoc_object::GetGoodRet Initial Comment: I wonder if the below patch possibly addresses a refcount/memory problem. Think its possible, that DODECREF(this) frees <*this> from memory, another released threads malloc uses the memory and this->virtualInst is bogus? ( In preceding function ui_assoc_object::DoKillAssoc there is a simlar technique to do "PyObject *vi = virtualInst;" - but for reverse reason ) ( I'm still in search of memory leaks/crashes on dual cores and fast CPUs when other threads are going on parallel to win32ui GUI mainthread. ) --- win32assoc.cpp.orig 2005-04-12 17:01:00.000000000 +0200 +++ win32assoc.cpp 2006-11-04 10:59:46.326646400 +0100 @@ -252,9 +252,10 @@ { if (this==NULL) return NULL; if (virtualInst) { + PyObject *vi = virtualInst; + DOINCREF(vi); DODECREF(this); - DOINCREF(virtualInst); - return virtualInst; + return vi; } else return this; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1590399&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 14:07:56
|
Bugs item #1587646, was opened at 2006-10-30 19:35 Message generated for change (Comment added) made by jaraco You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- Comment By: Jason R. Coombs (jaraco) Date: 2006-10-31 07:07 Message: Logged In: YES user_id=599869 One last time, this fix should work correctly. I had the wrong comparator in the last patch. --- win32timezone.py 2006-01-03 04:12:38.000000000 -0500 +++ win32timezone.py 2006-10-31 08:55:03.487946900 -0500 @@ -12,7 +12,7 @@ This module may be tested using the doctest module. Written by Jason R. Coombs (ja...@ja...). - Copyright © 2003. + Copyright © 2003-2006. All Rights Reserved. To use this time zone module with the datetime module, simply pass @@ -67,13 +67,31 @@ >>> tz = win32timezone.TimeZoneInfo( 'China Standard Time' ) >>> tz == pickle.loads( pickle.dumps( tz ) ) True + +>>> aest = win32timezone.TimeZoneInfo( 'AUS Eastern Standard Time' ) +>>> est = win32timezone.TimeZoneInfo( 'E. Australia Standard Time' ) +>>> dt = datetime.datetime( 2006, 11, 11, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2006-11-11 00:00:00' + +>>> dt = datetime.datetime( 2007, 1, 12, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-01-12 00:00:00' + +>>> dt = datetime.datetime( 2007, 6, 13, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-06-13 01:00:00' + """ from __future__ import generators __author__ = 'Jason R. Coombs <ja...@ja...>' __version__ = '$Revision: 1.5 $'[11:-2] -__vssauthor__ = '$Author: mhammond $'[9:-2] -__date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] +__sccauthor__ = '$Author: mhammond $'[9:-2] +__date__ = '$Date: 04-04-14 10:52 $'[10:-2] import os, _winreg, struct, datetime @@ -168,8 +186,15 @@ try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) + + if dstStart < dstEnd: + inDaylightSavings = dstStart <= dt.replace( tzinfo=None ) < dstEnd + else: + # in the southern hemisphere, daylight savings time + # typically ends before it begins in a given year. + inDaylightSavings = not ( dstEnd < dt.replace( tzinfo=None ) <= dstStart ) - if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: + if inDaylightSavings and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a ---------------------------------------------------------------------- Comment By: Jason R. Coombs (jaraco) Date: 2006-10-31 06:50 Message: Logged In: YES user_id=599869 Here is another version of the patch that addresses the encoding issue. --- win32timezone.py 2006-01-03 04:12:38.000000000 -0500 +++ win32timezone.py 2006-10-31 08:42:45.803675100 -0500 @@ -12,7 +12,7 @@ This module may be tested using the doctest module. Written by Jason R. Coombs (ja...@ja...). - Copyright © 2003. + Copyright © 2003-2006. All Rights Reserved. To use this time zone module with the datetime module, simply pass @@ -67,13 +67,31 @@ >>> tz = win32timezone.TimeZoneInfo( 'China Standard Time' ) >>> tz == pickle.loads( pickle.dumps( tz ) ) True + +>>> aest = win32timezone.TimeZoneInfo( 'AUS Eastern Standard Time' ) +>>> est = win32timezone.TimeZoneInfo( 'E. Australia Standard Time' ) +>>> dt = datetime.datetime( 2006, 11, 11, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2006-11-11 00:00:00' + +>>> dt = datetime.datetime( 2007, 1, 12, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-01-12 00:00:00' + +>>> dt = datetime.datetime( 2007, 6, 13, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-06-13 01:00:00' + """ from __future__ import generators __author__ = 'Jason R. Coombs <ja...@ja...>' __version__ = '$Revision: 1.5 $'[11:-2] -__vssauthor__ = '$Author: mhammond $'[9:-2] -__date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] +__sccauthor__ = '$Author: mhammond $'[9:-2] +__date__ = '$Date: 04-04-14 10:52 $'[10:-2] import os, _winreg, struct, datetime @@ -168,8 +186,15 @@ try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) + + if dstStart > dstEnd: + inDaylightSavings = dstStart <= dt.replace( tzinfo=None ) < dstEnd + else: + # in the southern hemisphere, daylight savings time + # typically ends before it begins in a given year. + inDaylightSavings = not ( dstEnd < dt.replace( tzinfo=None ) <= dstStart ) - if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: + if inDaylightSavings and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a ---------------------------------------------------------------------- Comment By: Jason R. Coombs (jaraco) Date: 2006-10-31 06:34 Message: Logged In: YES user_id=599869 I'm sorry. I did address this when I got the initial e-mail from Cameron. I had started to code a fix and then ran into some difficulty with date ranges, so put it on my task list, but hadn't gotten to it. Thanks for bumping me on this. I did the same thing as Mark at first, but then realized that only addresses the issue for the latter part of the year. If the time in question is in January, for example, the range of interest is ( GetDSTStartTime( dt.year-1), GetDSTEndTime( dt.year ) ). Therefore, I've coded the patch somewhat differently. I tried to do something more elegant, but it seems the best approach for the southern hemisphere is to test for exclusion from daylight savings time, as inclusion from daylight savings time includes two distinct periods for a given year. Here is another patch with some additional test cases that demonstrates correct functional behavior in all three parts of the year for the southern hemisphere timezones. Comments greatly appreciated. Patch follows (as I don't appear to have access to submit files). --- win32timezone.py 2006-01-03 04:12:38.000000000 -0500 +++ win32timezone.py 2006-10-31 08:26:26.803675100 -0500 @@ -12,7 +12,7 @@ This module may be tested using the doctest module. Written by Jason R. Coombs (ja...@ja...). - Copyright © 2003. + Copyright © 2003-2006. All Rights Reserved. To use this time zone module with the datetime module, simply pass @@ -67,13 +67,31 @@ >>> tz = win32timezone.TimeZoneInfo( 'China Standard Time' ) >>> tz == pickle.loads( pickle.dumps( tz ) ) True + +>>> aest = win32timezone.TimeZoneInfo( 'AUS Eastern Standard Time' ) +>>> est = win32timezone.TimeZoneInfo( 'E. Australia Standard Time' ) +>>> dt = datetime.datetime( 2006, 11, 11, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2006-11-11 00:00:00' + +>>> dt = datetime.datetime( 2007, 1, 12, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-01-12 00:00:00' + +>>> dt = datetime.datetime( 2007, 6, 13, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-06-13 01:00:00' + """ from __future__ import generators __author__ = 'Jason R. Coombs <ja...@ja...>' __version__ = '$Revision: 1.5 $'[11:-2] -__vssauthor__ = '$Author: mhammond $'[9:-2] -__date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] +__sccauthor__ = '$Author: mhammond $'[9:-2] +__date__ = '$Date: 04-04-14 10:52 $'[10:-2] import os, _winreg, struct, datetime @@ -168,8 +186,15 @@ try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) + + if dstStart > dstEnd: + inDaylightSavings = dstStart <= dt.replace( tzinfo=None ) < dstEnd + else: + # in the southern hemisphere, daylight savings time + # typically ends before it begins in a given year. + inDaylightSavings = not ( dstEnd < dt.replace( tzinfo=None ) <= dstStart ) - if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: + if inDaylightSavings and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 22:22 Message: Logged In: YES user_id=14198 It appears your editor changed the whitespace in the file, and modified the utf8 'copyright' character. I've attached the changes as a patch and asked Jason to have a quick look. Thanks, Mark ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 21:50 Message: Logged In: YES user_id=284417 p.s. am in sunny Queensland :-) BrisVegus. Cameron. ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 21:48 Message: Logged In: YES user_id=284417 hope this is what yu are after. appended to bottom of module doctests ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 21:05 Message: Logged In: YES user_id=14198 I meant to ask this before, but can you please also give me an example of code that failed and works with the patch? I'm in Melbourne so should be able to test easily :) Thanks ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 20:24 Message: Logged In: YES user_id=284417 yes, much nicer! :-) also need to update value for dstend. (attached) Cheers, Cameron. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 19:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 13:50:30
|
Bugs item #1587646, was opened at 2006-10-30 19:35 Message generated for change (Comment added) made by jaraco You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- Comment By: Jason R. Coombs (jaraco) Date: 2006-10-31 06:50 Message: Logged In: YES user_id=599869 Here is another version of the patch that addresses the encoding issue. --- win32timezone.py 2006-01-03 04:12:38.000000000 -0500 +++ win32timezone.py 2006-10-31 08:42:45.803675100 -0500 @@ -12,7 +12,7 @@ This module may be tested using the doctest module. Written by Jason R. Coombs (ja...@ja...). - Copyright © 2003. + Copyright © 2003-2006. All Rights Reserved. To use this time zone module with the datetime module, simply pass @@ -67,13 +67,31 @@ >>> tz = win32timezone.TimeZoneInfo( 'China Standard Time' ) >>> tz == pickle.loads( pickle.dumps( tz ) ) True + +>>> aest = win32timezone.TimeZoneInfo( 'AUS Eastern Standard Time' ) +>>> est = win32timezone.TimeZoneInfo( 'E. Australia Standard Time' ) +>>> dt = datetime.datetime( 2006, 11, 11, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2006-11-11 00:00:00' + +>>> dt = datetime.datetime( 2007, 1, 12, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-01-12 00:00:00' + +>>> dt = datetime.datetime( 2007, 6, 13, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-06-13 01:00:00' + """ from __future__ import generators __author__ = 'Jason R. Coombs <ja...@ja...>' __version__ = '$Revision: 1.5 $'[11:-2] -__vssauthor__ = '$Author: mhammond $'[9:-2] -__date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] +__sccauthor__ = '$Author: mhammond $'[9:-2] +__date__ = '$Date: 04-04-14 10:52 $'[10:-2] import os, _winreg, struct, datetime @@ -168,8 +186,15 @@ try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) + + if dstStart > dstEnd: + inDaylightSavings = dstStart <= dt.replace( tzinfo=None ) < dstEnd + else: + # in the southern hemisphere, daylight savings time + # typically ends before it begins in a given year. + inDaylightSavings = not ( dstEnd < dt.replace( tzinfo=None ) <= dstStart ) - if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: + if inDaylightSavings and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a ---------------------------------------------------------------------- Comment By: Jason R. Coombs (jaraco) Date: 2006-10-31 06:34 Message: Logged In: YES user_id=599869 I'm sorry. I did address this when I got the initial e-mail from Cameron. I had started to code a fix and then ran into some difficulty with date ranges, so put it on my task list, but hadn't gotten to it. Thanks for bumping me on this. I did the same thing as Mark at first, but then realized that only addresses the issue for the latter part of the year. If the time in question is in January, for example, the range of interest is ( GetDSTStartTime( dt.year-1), GetDSTEndTime( dt.year ) ). Therefore, I've coded the patch somewhat differently. I tried to do something more elegant, but it seems the best approach for the southern hemisphere is to test for exclusion from daylight savings time, as inclusion from daylight savings time includes two distinct periods for a given year. Here is another patch with some additional test cases that demonstrates correct functional behavior in all three parts of the year for the southern hemisphere timezones. Comments greatly appreciated. Patch follows (as I don't appear to have access to submit files). --- win32timezone.py 2006-01-03 04:12:38.000000000 -0500 +++ win32timezone.py 2006-10-31 08:26:26.803675100 -0500 @@ -12,7 +12,7 @@ This module may be tested using the doctest module. Written by Jason R. Coombs (ja...@ja...). - Copyright © 2003. + Copyright © 2003-2006. All Rights Reserved. To use this time zone module with the datetime module, simply pass @@ -67,13 +67,31 @@ >>> tz = win32timezone.TimeZoneInfo( 'China Standard Time' ) >>> tz == pickle.loads( pickle.dumps( tz ) ) True + +>>> aest = win32timezone.TimeZoneInfo( 'AUS Eastern Standard Time' ) +>>> est = win32timezone.TimeZoneInfo( 'E. Australia Standard Time' ) +>>> dt = datetime.datetime( 2006, 11, 11, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2006-11-11 00:00:00' + +>>> dt = datetime.datetime( 2007, 1, 12, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-01-12 00:00:00' + +>>> dt = datetime.datetime( 2007, 6, 13, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-06-13 01:00:00' + """ from __future__ import generators __author__ = 'Jason R. Coombs <ja...@ja...>' __version__ = '$Revision: 1.5 $'[11:-2] -__vssauthor__ = '$Author: mhammond $'[9:-2] -__date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] +__sccauthor__ = '$Author: mhammond $'[9:-2] +__date__ = '$Date: 04-04-14 10:52 $'[10:-2] import os, _winreg, struct, datetime @@ -168,8 +186,15 @@ try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) + + if dstStart > dstEnd: + inDaylightSavings = dstStart <= dt.replace( tzinfo=None ) < dstEnd + else: + # in the southern hemisphere, daylight savings time + # typically ends before it begins in a given year. + inDaylightSavings = not ( dstEnd < dt.replace( tzinfo=None ) <= dstStart ) - if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: + if inDaylightSavings and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 22:22 Message: Logged In: YES user_id=14198 It appears your editor changed the whitespace in the file, and modified the utf8 'copyright' character. I've attached the changes as a patch and asked Jason to have a quick look. Thanks, Mark ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 21:50 Message: Logged In: YES user_id=284417 p.s. am in sunny Queensland :-) BrisVegus. Cameron. ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 21:48 Message: Logged In: YES user_id=284417 hope this is what yu are after. appended to bottom of module doctests ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 21:05 Message: Logged In: YES user_id=14198 I meant to ask this before, but can you please also give me an example of code that failed and works with the patch? I'm in Melbourne so should be able to test easily :) Thanks ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 20:24 Message: Logged In: YES user_id=284417 yes, much nicer! :-) also need to update value for dstend. (attached) Cheers, Cameron. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 19:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 13:34:25
|
Bugs item #1587646, was opened at 2006-10-30 19:35 Message generated for change (Comment added) made by jaraco You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- Comment By: Jason R. Coombs (jaraco) Date: 2006-10-31 06:34 Message: Logged In: YES user_id=599869 I'm sorry. I did address this when I got the initial e-mail from Cameron. I had started to code a fix and then ran into some difficulty with date ranges, so put it on my task list, but hadn't gotten to it. Thanks for bumping me on this. I did the same thing as Mark at first, but then realized that only addresses the issue for the latter part of the year. If the time in question is in January, for example, the range of interest is ( GetDSTStartTime( dt.year-1), GetDSTEndTime( dt.year ) ). Therefore, I've coded the patch somewhat differently. I tried to do something more elegant, but it seems the best approach for the southern hemisphere is to test for exclusion from daylight savings time, as inclusion from daylight savings time includes two distinct periods for a given year. Here is another patch with some additional test cases that demonstrates correct functional behavior in all three parts of the year for the southern hemisphere timezones. Comments greatly appreciated. Patch follows (as I don't appear to have access to submit files). --- win32timezone.py 2006-01-03 04:12:38.000000000 -0500 +++ win32timezone.py 2006-10-31 08:26:26.803675100 -0500 @@ -12,7 +12,7 @@ This module may be tested using the doctest module. Written by Jason R. Coombs (ja...@ja...). - Copyright © 2003. + Copyright © 2003-2006. All Rights Reserved. To use this time zone module with the datetime module, simply pass @@ -67,13 +67,31 @@ >>> tz = win32timezone.TimeZoneInfo( 'China Standard Time' ) >>> tz == pickle.loads( pickle.dumps( tz ) ) True + +>>> aest = win32timezone.TimeZoneInfo( 'AUS Eastern Standard Time' ) +>>> est = win32timezone.TimeZoneInfo( 'E. Australia Standard Time' ) +>>> dt = datetime.datetime( 2006, 11, 11, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2006-11-11 00:00:00' + +>>> dt = datetime.datetime( 2007, 1, 12, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-01-12 00:00:00' + +>>> dt = datetime.datetime( 2007, 6, 13, 1, 0, 0, tzinfo = aest ) +>>> estdt = dt.astimezone( est ) +>>> estdt.strftime( '%Y-%m-%d %H:%M:%S' ) +'2007-06-13 01:00:00' + """ from __future__ import generators __author__ = 'Jason R. Coombs <ja...@ja...>' __version__ = '$Revision: 1.5 $'[11:-2] -__vssauthor__ = '$Author: mhammond $'[9:-2] -__date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] +__sccauthor__ = '$Author: mhammond $'[9:-2] +__date__ = '$Date: 04-04-14 10:52 $'[10:-2] import os, _winreg, struct, datetime @@ -168,8 +186,15 @@ try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) + + if dstStart > dstEnd: + inDaylightSavings = dstStart <= dt.replace( tzinfo=None ) < dstEnd + else: + # in the southern hemisphere, daylight savings time + # typically ends before it begins in a given year. + inDaylightSavings = not ( dstEnd < dt.replace( tzinfo=None ) <= dstStart ) - if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: + if inDaylightSavings and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 22:22 Message: Logged In: YES user_id=14198 It appears your editor changed the whitespace in the file, and modified the utf8 'copyright' character. I've attached the changes as a patch and asked Jason to have a quick look. Thanks, Mark ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 21:50 Message: Logged In: YES user_id=284417 p.s. am in sunny Queensland :-) BrisVegus. Cameron. ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 21:48 Message: Logged In: YES user_id=284417 hope this is what yu are after. appended to bottom of module doctests ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 21:05 Message: Logged In: YES user_id=14198 I meant to ask this before, but can you please also give me an example of code that failed and works with the patch? I'm in Melbourne so should be able to test easily :) Thanks ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-30 20:24 Message: Logged In: YES user_id=284417 yes, much nicer! :-) also need to update value for dstend. (attached) Cheers, Cameron. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-30 19:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 05:22:33
|
Bugs item #1587646, was opened at 2006-10-31 13:35 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2006-10-31 16:22 Message: Logged In: YES user_id=14198 It appears your editor changed the whitespace in the file, and modified the utf8 'copyright' character. I've attached the changes as a patch and asked Jason to have a quick look. Thanks, Mark ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 15:50 Message: Logged In: YES user_id=284417 p.s. am in sunny Queensland :-) BrisVegus. Cameron. ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 15:48 Message: Logged In: YES user_id=284417 hope this is what yu are after. appended to bottom of module doctests ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-31 15:05 Message: Logged In: YES user_id=14198 I meant to ask this before, but can you please also give me an example of code that failed and works with the patch? I'm in Melbourne so should be able to test easily :) Thanks ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 14:24 Message: Logged In: YES user_id=284417 yes, much nicer! :-) also need to update value for dstend. (attached) Cheers, Cameron. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-31 13:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 04:50:24
|
Bugs item #1587646, was opened at 2006-10-31 02:35 Message generated for change (Comment added) made by noremac_eel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- >Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 04:50 Message: Logged In: YES user_id=284417 p.s. am in sunny Queensland :-) BrisVegus. Cameron. ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 04:48 Message: Logged In: YES user_id=284417 hope this is what yu are after. appended to bottom of module doctests ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-31 04:05 Message: Logged In: YES user_id=14198 I meant to ask this before, but can you please also give me an example of code that failed and works with the patch? I'm in Melbourne so should be able to test easily :) Thanks ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 03:24 Message: Logged In: YES user_id=284417 yes, much nicer! :-) also need to update value for dstend. (attached) Cheers, Cameron. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-31 02:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 04:48:51
|
Bugs item #1587646, was opened at 2006-10-31 02:35 Message generated for change (Comment added) made by noremac_eel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- >Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 04:48 Message: Logged In: YES user_id=284417 hope this is what yu are after. appended to bottom of module doctests ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-31 04:05 Message: Logged In: YES user_id=14198 I meant to ask this before, but can you please also give me an example of code that failed and works with the patch? I'm in Melbourne so should be able to test easily :) Thanks ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 03:24 Message: Logged In: YES user_id=284417 yes, much nicer! :-) also need to update value for dstend. (attached) Cheers, Cameron. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-31 02:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 04:05:17
|
Bugs item #1587646, was opened at 2006-10-31 13:35 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2006-10-31 15:05 Message: Logged In: YES user_id=14198 I meant to ask this before, but can you please also give me an example of code that failed and works with the patch? I'm in Melbourne so should be able to test easily :) Thanks ---------------------------------------------------------------------- Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 14:24 Message: Logged In: YES user_id=284417 yes, much nicer! :-) also need to update value for dstend. (attached) Cheers, Cameron. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-31 13:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 03:24:44
|
Bugs item #1587646, was opened at 2006-10-31 02:35 Message generated for change (Comment added) made by noremac_eel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- >Comment By: Cameron LEE (noremac_eel) Date: 2006-10-31 03:24 Message: Logged In: YES user_id=284417 yes, much nicer! :-) also need to update value for dstend. (attached) Cheers, Cameron. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-31 02:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 02:50:56
|
Bugs item #1587646, was opened at 2006-10-31 13:35 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2006-10-31 13:50 Message: Logged In: YES user_id=14198 Wouldn't a better fix be to check if dstStart > dstEnd rather than assuming something special about August? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-31 02:35:43
|
Bugs item #1587646, was opened at 2006-10-31 02:35 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cameron LEE (noremac_eel) Assigned to: Nobody/Anonymous (nobody) Summary: win32timezone: southern hemisphere daylight savings problem Initial Comment: I found a bug in the win32timezone: It doesn’t handle daylight savings for us poor southern hemispherians. The logic works great for the northerners as your summer is in the middle of the year. Ours however straddles 2 years. The following fixes that. My logic was that if the dst start month was higher than august, then you aren’t in the north. def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" if dt is None: return assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart.month > 8: if not (dstEnd < dt.replace( tzinfo=None ) <= dstStart) and not self.fixedStandardTime: result = self.daylightBiasOffset else: if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587646&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-30 08:20:31
|
Bugs item #1587023, was opened at 2006-10-30 09:19 Message generated for change (Settings changed) made by j_lindvall You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587023&group_id=78018 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: com Group: None Status: Open Resolution: None >Priority: 8 Private: No Submitted By: Johan Lindvall (j_lindvall) >Assigned to: Mark Hammond (mhammond) Summary: ActiveScript, LazyDispatchItem doesn't rename properties Initial Comment: The problem seems to be that LazyDispatchItem doesn't remap the properties as DispatchItem does. If I disable the LazyDispatchItem generation in MakeOleRepr and always return a DispatchItem object, the script works as expected. See the following thread for more information: http://mail.python.org/pipermail/python-win32/2006-October/005174.html ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587023&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-30 08:20:00
|
Bugs item #1587023, was opened at 2006-10-30 09:19 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587023&group_id=78018 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: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Johan Lindvall (j_lindvall) Assigned to: Nobody/Anonymous (nobody) Summary: ActiveScript, LazyDispatchItem doesn't rename properties Initial Comment: The problem seems to be that LazyDispatchItem doesn't remap the properties as DispatchItem does. If I disable the LazyDispatchItem generation in MakeOleRepr and always return a DispatchItem object, the script works as expected. See the following thread for more information: http://mail.python.org/pipermail/python-win32/2006-October/005174.html ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1587023&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-24 07:11:28
|
Bugs item #1582744, was opened at 2006-10-23 09:44 Message generated for change (Comment added) made by cheengshuchin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 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: win32 Group: None Status: Closed Resolution: Invalid Priority: 5 Private: No Submitted By: cheeng shu chin (cheengshuchin) Assigned to: Nobody/Anonymous (nobody) Summary: isapi extension seem Error for large file posting in iis Initial Comment: hi all, I try to submit a large file (2Mb+) to iis with pywin32 isapi extension via html form (POST method), but end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. This happen even with attached module "C:\Python24 \Lib\site-packages\isapi\test\extension_simple.py". The form with this "CONTENT_TYPE=multipart/form-data; boundary=---------------------------7d629bf20426" is it a limitation in isapi or some bug in it??? can someone help me on this??? ---------------------------------------------------------------------- >Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 07:11 Message: Logged In: YES user_id=1546069 yes..fully agree with you.... sorry for it...as i post it as a bug priviously... thank a lot for your help...:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-24 06:45 Message: Logged In: YES user_id=14198 I'm closing this as I don't believe it relates to a bug in pywin32. If you just need general help with ISAPI, the pywin32 bugs isn't the place; the pyt...@py... mailing list would be more appropriate. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-24 06:43 Message: Logged In: YES user_id=14198 You don't want to read all the data in one chunk - you may exhaust memory if the file is truly huge. A better solution is to loop reading a fixed size each time (eg, 8k) These semantics are imposed by IIS and ISAPI. I think it is best to expose these semantics directly to the programmer, rather than trying to outsmart their buffering and other performance related facilities. This also lets you consult the IIS documentation for the exact semantics, something you should do as it will answer other questions you have about how IIS manages the input stream. Cheers ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 05:43 Message: Logged In: YES user_id=1546069 I guess i know what was happened and solved the puzzle...:)(Please do correct me if i'm wrong) found: ecb.ReadClient is a block function same as file object read method. all POST data in iis buffer with total size = ecb.TotalBytes ecb always try to read those data from buffer as many as possible with return read size in ecb.AvailableBytes. when ecb.TotalBytes<>ecb.AvailableBytes: it mean still have some data leave in the iis buffer (specially for a large file, which bigger then ecb buffer store) if we directly close the ecb with ecb.DoneWithSession()..it will trigger iis to raise error, as you didn't finish to read it out from its own buufer. this will follow by return error page to client browser with "The page cannot be displayed" ....:( as long as you extract all data from IIS buffer, the web site will work correctly.....:) so the solution: ======================================================= def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType #print 'AvailableData :',ecb.AvailableData st=ecb.AvailableData if ecb.TotalBytes<>ecb.AvailableBytes: print ecb.TotalBytes,ecb.AvailableBytes st+=ecb.ReadClient(ecb.TotalBytes-ecb.AvailableBytes) print '\r\n##_______________________________________________________##\r\n' print st print '\r\n##_______________________________________________________##\r\n' return 'csc' ======================================================= then it seem work fine now..........the page return with correct respond and everybody happy with it......:) Note: 1. i still need to check the data after POST is identicall to original source. 2. i still need to convert isapi vars to CGI enviroment vars 3. i still need to represent those data in XML form, which will have greater potential to any kind of web base subsystem suggestion: 1 can ecb just return all complete/full data in buffer ruther then call ecb.ReadClient repeatly??? 2 or just let ecb collect all others data except ecb.AvailableData, which still leave those data in iis buffer and we just make a call ecb.ReadClient(ecb.TotalBytes) to read it out????? special thank to mark (one of my respected programmer) for yours valuable advises and support. thank a lot..... Mark, Please do correct me if i'm wrong.... BTW i will do further test to confirm the case..... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-24 05:25 Message: Logged In: YES user_id=14198 Yes, as the ISAPI docs state, .AvailableData is only the available data, and ReadClient() must be used to read the rest. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:47 Message: Logged In: YES user_id=1546069 it seem like isapi ecb can return/extract all uploaded data from iis..and still lift some in the buffer. should i use ecb.ReadClient method in a loop to extract all data in buffer???? ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:40 Message: Logged In: YES user_id=1546069 i had check with 'live headers' seem no error. is it a memory leak issue in here??? as i still can post a large file(python-2.4.4.msi) to the page(>2MB). I still have result from win32traceutil window output but seem "truncated".... and browser reply with "The page cannot be displayed" please refer to attachment.....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:28 Message: Logged In: YES user_id=1546069 if I post a smaller file (<1MB), the semple seem work fine, but will fail on large file.... i found it('live headers') already, as priviously i try to find it via FF extension search only...:( those sample(extension_simple.py & advanced.py) only work with small file submit but not for bigggg file.... FYI: ==================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test2?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> ==================== new function define in extension_simple.py ----------------------- def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType print 'AvailableData :',ecb.AvailableData return 'csc' --------------------- please check the output in attachment....:) But this fail if you select a big file(>2MB)...... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 12:57 Message: Logged In: YES user_id=14198 Yep - in Aus - nearly bed time :) I suggest we try and get some of the samples working first. Let's just take this to email, but unless the samples work, your POST example isn't going to. I typed "live headers" into google and the first hit was the correct link from mozdev.org, as were most of the top 10 - I'm surprised you had trouble finding it. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 11:07 Message: Logged In: YES user_id=1546069 hi mark, i can't find "live headers" extension for FF. so i can't provide you the header info....:( BTW thank for your help... r u still in aust.?? (almost 7:30pm now...:( ) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:52 Message: Logged In: YES user_id=1546069 nope...non of them(I'm afraid).... actually we can POST file to iis server via "enctype='multipart/form-da". and we can read it out via isapi ecb.AvailableData, ecb.ContentType and with total bytes size ecb.TotalBytes. then we can use cgi module parse it after inject some isapi vars to os.enviroment(to make it become seem like CGI). Then I can expost all info in XML form via 4suit....:) I try to find "live headers" and try it again....:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 10:37 Message: Logged In: YES user_id=14198 I'm afraid I don't know how ISAPI is supposed to handle post data. You said you can't get the 'advanced' sample working - do any of them work? Maybe try the 'live headers' firefox extension - it may give you more clues what is going on. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:26 Message: Logged In: YES user_id=1546069 I try to dig further, found that ECB seem work and recieve post data, even i can redirect those data to win32traceutil window include http vars or "print >>ecb, data", but it always end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. ......???????!!!!!....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:13 Message: Logged In: YES user_id=1546069 hi mark, thank for your fast respond.....:) nothing in win32traceutil window(except "Tester dispatching ******"). i had try "advanced.py" as well, seem not work.... Attached with html form ===================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test1?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> =============================== BTW, Thank a lot for your help...:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 10:06 Message: Logged In: YES user_id=14198 Do you see a traceback in the win32traceutil window? Otherwise you will need to provide a sample which demonstrates the problem ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 09:54 Message: Logged In: YES user_id=1546069 some correction....: I can't compile it to any kind of isapi DLL as pywin32 ISAPI do...:( sorry for that...:( ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 09:52 Message: Logged In: YES user_id=1546069 i did samething with pyisapie mudule, it seem work. but i can compile it to any kind of dll. can i know what was happend in isapi module??? BTW, Thank a lot for those look in this.....:) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-24 06:45:31
|
Bugs item #1582744, was opened at 2006-10-23 19:44 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 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: win32 Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: cheeng shu chin (cheengshuchin) Assigned to: Nobody/Anonymous (nobody) Summary: isapi extension seem Error for large file posting in iis Initial Comment: hi all, I try to submit a large file (2Mb+) to iis with pywin32 isapi extension via html form (POST method), but end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. This happen even with attached module "C:\Python24 \Lib\site-packages\isapi\test\extension_simple.py". The form with this "CONTENT_TYPE=multipart/form-data; boundary=---------------------------7d629bf20426" is it a limitation in isapi or some bug in it??? can someone help me on this??? ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2006-10-24 16:45 Message: Logged In: YES user_id=14198 I'm closing this as I don't believe it relates to a bug in pywin32. If you just need general help with ISAPI, the pywin32 bugs isn't the place; the pyt...@py... mailing list would be more appropriate. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-24 16:43 Message: Logged In: YES user_id=14198 You don't want to read all the data in one chunk - you may exhaust memory if the file is truly huge. A better solution is to loop reading a fixed size each time (eg, 8k) These semantics are imposed by IIS and ISAPI. I think it is best to expose these semantics directly to the programmer, rather than trying to outsmart their buffering and other performance related facilities. This also lets you consult the IIS documentation for the exact semantics, something you should do as it will answer other questions you have about how IIS manages the input stream. Cheers ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 15:43 Message: Logged In: YES user_id=1546069 I guess i know what was happened and solved the puzzle...:)(Please do correct me if i'm wrong) found: ecb.ReadClient is a block function same as file object read method. all POST data in iis buffer with total size = ecb.TotalBytes ecb always try to read those data from buffer as many as possible with return read size in ecb.AvailableBytes. when ecb.TotalBytes<>ecb.AvailableBytes: it mean still have some data leave in the iis buffer (specially for a large file, which bigger then ecb buffer store) if we directly close the ecb with ecb.DoneWithSession()..it will trigger iis to raise error, as you didn't finish to read it out from its own buufer. this will follow by return error page to client browser with "The page cannot be displayed" ....:( as long as you extract all data from IIS buffer, the web site will work correctly.....:) so the solution: ======================================================= def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType #print 'AvailableData :',ecb.AvailableData st=ecb.AvailableData if ecb.TotalBytes<>ecb.AvailableBytes: print ecb.TotalBytes,ecb.AvailableBytes st+=ecb.ReadClient(ecb.TotalBytes-ecb.AvailableBytes) print '\r\n##_______________________________________________________##\r\n' print st print '\r\n##_______________________________________________________##\r\n' return 'csc' ======================================================= then it seem work fine now..........the page return with correct respond and everybody happy with it......:) Note: 1. i still need to check the data after POST is identicall to original source. 2. i still need to convert isapi vars to CGI enviroment vars 3. i still need to represent those data in XML form, which will have greater potential to any kind of web base subsystem suggestion: 1 can ecb just return all complete/full data in buffer ruther then call ecb.ReadClient repeatly??? 2 or just let ecb collect all others data except ecb.AvailableData, which still leave those data in iis buffer and we just make a call ecb.ReadClient(ecb.TotalBytes) to read it out????? special thank to mark (one of my respected programmer) for yours valuable advises and support. thank a lot..... Mark, Please do correct me if i'm wrong.... BTW i will do further test to confirm the case..... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-24 15:25 Message: Logged In: YES user_id=14198 Yes, as the ISAPI docs state, .AvailableData is only the available data, and ReadClient() must be used to read the rest. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:47 Message: Logged In: YES user_id=1546069 it seem like isapi ecb can return/extract all uploaded data from iis..and still lift some in the buffer. should i use ecb.ReadClient method in a loop to extract all data in buffer???? ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:40 Message: Logged In: YES user_id=1546069 i had check with 'live headers' seem no error. is it a memory leak issue in here??? as i still can post a large file(python-2.4.4.msi) to the page(>2MB). I still have result from win32traceutil window output but seem "truncated".... and browser reply with "The page cannot be displayed" please refer to attachment.....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:28 Message: Logged In: YES user_id=1546069 if I post a smaller file (<1MB), the semple seem work fine, but will fail on large file.... i found it('live headers') already, as priviously i try to find it via FF extension search only...:( those sample(extension_simple.py & advanced.py) only work with small file submit but not for bigggg file.... FYI: ==================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test2?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> ==================== new function define in extension_simple.py ----------------------- def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType print 'AvailableData :',ecb.AvailableData return 'csc' --------------------- please check the output in attachment....:) But this fail if you select a big file(>2MB)...... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 22:57 Message: Logged In: YES user_id=14198 Yep - in Aus - nearly bed time :) I suggest we try and get some of the samples working first. Let's just take this to email, but unless the samples work, your POST example isn't going to. I typed "live headers" into google and the first hit was the correct link from mozdev.org, as were most of the top 10 - I'm surprised you had trouble finding it. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 21:07 Message: Logged In: YES user_id=1546069 hi mark, i can't find "live headers" extension for FF. so i can't provide you the header info....:( BTW thank for your help... r u still in aust.?? (almost 7:30pm now...:( ) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:52 Message: Logged In: YES user_id=1546069 nope...non of them(I'm afraid).... actually we can POST file to iis server via "enctype='multipart/form-da". and we can read it out via isapi ecb.AvailableData, ecb.ContentType and with total bytes size ecb.TotalBytes. then we can use cgi module parse it after inject some isapi vars to os.enviroment(to make it become seem like CGI). Then I can expost all info in XML form via 4suit....:) I try to find "live headers" and try it again....:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 20:37 Message: Logged In: YES user_id=14198 I'm afraid I don't know how ISAPI is supposed to handle post data. You said you can't get the 'advanced' sample working - do any of them work? Maybe try the 'live headers' firefox extension - it may give you more clues what is going on. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:26 Message: Logged In: YES user_id=1546069 I try to dig further, found that ECB seem work and recieve post data, even i can redirect those data to win32traceutil window include http vars or "print >>ecb, data", but it always end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. ......???????!!!!!....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:13 Message: Logged In: YES user_id=1546069 hi mark, thank for your fast respond.....:) nothing in win32traceutil window(except "Tester dispatching ******"). i had try "advanced.py" as well, seem not work.... Attached with html form ===================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test1?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> =============================== BTW, Thank a lot for your help...:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 20:06 Message: Logged In: YES user_id=14198 Do you see a traceback in the win32traceutil window? Otherwise you will need to provide a sample which demonstrates the problem ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 19:54 Message: Logged In: YES user_id=1546069 some correction....: I can't compile it to any kind of isapi DLL as pywin32 ISAPI do...:( sorry for that...:( ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 19:52 Message: Logged In: YES user_id=1546069 i did samething with pyisapie mudule, it seem work. but i can compile it to any kind of dll. can i know what was happend in isapi module??? BTW, Thank a lot for those look in this.....:) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-24 06:43:57
|
Bugs item #1582744, was opened at 2006-10-23 19:44 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: cheeng shu chin (cheengshuchin) Assigned to: Nobody/Anonymous (nobody) Summary: isapi extension seem Error for large file posting in iis Initial Comment: hi all, I try to submit a large file (2Mb+) to iis with pywin32 isapi extension via html form (POST method), but end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. This happen even with attached module "C:\Python24 \Lib\site-packages\isapi\test\extension_simple.py". The form with this "CONTENT_TYPE=multipart/form-data; boundary=---------------------------7d629bf20426" is it a limitation in isapi or some bug in it??? can someone help me on this??? ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2006-10-24 16:43 Message: Logged In: YES user_id=14198 You don't want to read all the data in one chunk - you may exhaust memory if the file is truly huge. A better solution is to loop reading a fixed size each time (eg, 8k) These semantics are imposed by IIS and ISAPI. I think it is best to expose these semantics directly to the programmer, rather than trying to outsmart their buffering and other performance related facilities. This also lets you consult the IIS documentation for the exact semantics, something you should do as it will answer other questions you have about how IIS manages the input stream. Cheers ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 15:43 Message: Logged In: YES user_id=1546069 I guess i know what was happened and solved the puzzle...:)(Please do correct me if i'm wrong) found: ecb.ReadClient is a block function same as file object read method. all POST data in iis buffer with total size = ecb.TotalBytes ecb always try to read those data from buffer as many as possible with return read size in ecb.AvailableBytes. when ecb.TotalBytes<>ecb.AvailableBytes: it mean still have some data leave in the iis buffer (specially for a large file, which bigger then ecb buffer store) if we directly close the ecb with ecb.DoneWithSession()..it will trigger iis to raise error, as you didn't finish to read it out from its own buufer. this will follow by return error page to client browser with "The page cannot be displayed" ....:( as long as you extract all data from IIS buffer, the web site will work correctly.....:) so the solution: ======================================================= def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType #print 'AvailableData :',ecb.AvailableData st=ecb.AvailableData if ecb.TotalBytes<>ecb.AvailableBytes: print ecb.TotalBytes,ecb.AvailableBytes st+=ecb.ReadClient(ecb.TotalBytes-ecb.AvailableBytes) print '\r\n##_______________________________________________________##\r\n' print st print '\r\n##_______________________________________________________##\r\n' return 'csc' ======================================================= then it seem work fine now..........the page return with correct respond and everybody happy with it......:) Note: 1. i still need to check the data after POST is identicall to original source. 2. i still need to convert isapi vars to CGI enviroment vars 3. i still need to represent those data in XML form, which will have greater potential to any kind of web base subsystem suggestion: 1 can ecb just return all complete/full data in buffer ruther then call ecb.ReadClient repeatly??? 2 or just let ecb collect all others data except ecb.AvailableData, which still leave those data in iis buffer and we just make a call ecb.ReadClient(ecb.TotalBytes) to read it out????? special thank to mark (one of my respected programmer) for yours valuable advises and support. thank a lot..... Mark, Please do correct me if i'm wrong.... BTW i will do further test to confirm the case..... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-24 15:25 Message: Logged In: YES user_id=14198 Yes, as the ISAPI docs state, .AvailableData is only the available data, and ReadClient() must be used to read the rest. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:47 Message: Logged In: YES user_id=1546069 it seem like isapi ecb can return/extract all uploaded data from iis..and still lift some in the buffer. should i use ecb.ReadClient method in a loop to extract all data in buffer???? ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:40 Message: Logged In: YES user_id=1546069 i had check with 'live headers' seem no error. is it a memory leak issue in here??? as i still can post a large file(python-2.4.4.msi) to the page(>2MB). I still have result from win32traceutil window output but seem "truncated".... and browser reply with "The page cannot be displayed" please refer to attachment.....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:28 Message: Logged In: YES user_id=1546069 if I post a smaller file (<1MB), the semple seem work fine, but will fail on large file.... i found it('live headers') already, as priviously i try to find it via FF extension search only...:( those sample(extension_simple.py & advanced.py) only work with small file submit but not for bigggg file.... FYI: ==================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test2?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> ==================== new function define in extension_simple.py ----------------------- def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType print 'AvailableData :',ecb.AvailableData return 'csc' --------------------- please check the output in attachment....:) But this fail if you select a big file(>2MB)...... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 22:57 Message: Logged In: YES user_id=14198 Yep - in Aus - nearly bed time :) I suggest we try and get some of the samples working first. Let's just take this to email, but unless the samples work, your POST example isn't going to. I typed "live headers" into google and the first hit was the correct link from mozdev.org, as were most of the top 10 - I'm surprised you had trouble finding it. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 21:07 Message: Logged In: YES user_id=1546069 hi mark, i can't find "live headers" extension for FF. so i can't provide you the header info....:( BTW thank for your help... r u still in aust.?? (almost 7:30pm now...:( ) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:52 Message: Logged In: YES user_id=1546069 nope...non of them(I'm afraid).... actually we can POST file to iis server via "enctype='multipart/form-da". and we can read it out via isapi ecb.AvailableData, ecb.ContentType and with total bytes size ecb.TotalBytes. then we can use cgi module parse it after inject some isapi vars to os.enviroment(to make it become seem like CGI). Then I can expost all info in XML form via 4suit....:) I try to find "live headers" and try it again....:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 20:37 Message: Logged In: YES user_id=14198 I'm afraid I don't know how ISAPI is supposed to handle post data. You said you can't get the 'advanced' sample working - do any of them work? Maybe try the 'live headers' firefox extension - it may give you more clues what is going on. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:26 Message: Logged In: YES user_id=1546069 I try to dig further, found that ECB seem work and recieve post data, even i can redirect those data to win32traceutil window include http vars or "print >>ecb, data", but it always end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. ......???????!!!!!....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:13 Message: Logged In: YES user_id=1546069 hi mark, thank for your fast respond.....:) nothing in win32traceutil window(except "Tester dispatching ******"). i had try "advanced.py" as well, seem not work.... Attached with html form ===================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test1?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> =============================== BTW, Thank a lot for your help...:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 20:06 Message: Logged In: YES user_id=14198 Do you see a traceback in the win32traceutil window? Otherwise you will need to provide a sample which demonstrates the problem ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 19:54 Message: Logged In: YES user_id=1546069 some correction....: I can't compile it to any kind of isapi DLL as pywin32 ISAPI do...:( sorry for that...:( ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 19:52 Message: Logged In: YES user_id=1546069 i did samething with pyisapie mudule, it seem work. but i can compile it to any kind of dll. can i know what was happend in isapi module??? BTW, Thank a lot for those look in this.....:) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-24 05:43:27
|
Bugs item #1582744, was opened at 2006-10-23 09:44 Message generated for change (Comment added) made by cheengshuchin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 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: win32 Group: None >Status: Open >Resolution: None Priority: 5 Private: No Submitted By: cheeng shu chin (cheengshuchin) Assigned to: Nobody/Anonymous (nobody) Summary: isapi extension seem Error for large file posting in iis Initial Comment: hi all, I try to submit a large file (2Mb+) to iis with pywin32 isapi extension via html form (POST method), but end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. This happen even with attached module "C:\Python24 \Lib\site-packages\isapi\test\extension_simple.py". The form with this "CONTENT_TYPE=multipart/form-data; boundary=---------------------------7d629bf20426" is it a limitation in isapi or some bug in it??? can someone help me on this??? ---------------------------------------------------------------------- >Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 05:43 Message: Logged In: YES user_id=1546069 I guess i know what was happened and solved the puzzle...:)(Please do correct me if i'm wrong) found: ecb.ReadClient is a block function same as file object read method. all POST data in iis buffer with total size = ecb.TotalBytes ecb always try to read those data from buffer as many as possible with return read size in ecb.AvailableBytes. when ecb.TotalBytes<>ecb.AvailableBytes: it mean still have some data leave in the iis buffer (specially for a large file, which bigger then ecb buffer store) if we directly close the ecb with ecb.DoneWithSession()..it will trigger iis to raise error, as you didn't finish to read it out from its own buufer. this will follow by return error page to client browser with "The page cannot be displayed" ....:( as long as you extract all data from IIS buffer, the web site will work correctly.....:) so the solution: ======================================================= def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType #print 'AvailableData :',ecb.AvailableData st=ecb.AvailableData if ecb.TotalBytes<>ecb.AvailableBytes: print ecb.TotalBytes,ecb.AvailableBytes st+=ecb.ReadClient(ecb.TotalBytes-ecb.AvailableBytes) print '\r\n##_______________________________________________________##\r\n' print st print '\r\n##_______________________________________________________##\r\n' return 'csc' ======================================================= then it seem work fine now..........the page return with correct respond and everybody happy with it......:) Note: 1. i still need to check the data after POST is identicall to original source. 2. i still need to convert isapi vars to CGI enviroment vars 3. i still need to represent those data in XML form, which will have greater potential to any kind of web base subsystem suggestion: 1 can ecb just return all complete/full data in buffer ruther then call ecb.ReadClient repeatly??? 2 or just let ecb collect all others data except ecb.AvailableData, which still leave those data in iis buffer and we just make a call ecb.ReadClient(ecb.TotalBytes) to read it out????? special thank to mark (one of my respected programmer) for yours valuable advises and support. thank a lot..... Mark, Please do correct me if i'm wrong.... BTW i will do further test to confirm the case..... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-24 05:25 Message: Logged In: YES user_id=14198 Yes, as the ISAPI docs state, .AvailableData is only the available data, and ReadClient() must be used to read the rest. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:47 Message: Logged In: YES user_id=1546069 it seem like isapi ecb can return/extract all uploaded data from iis..and still lift some in the buffer. should i use ecb.ReadClient method in a loop to extract all data in buffer???? ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:40 Message: Logged In: YES user_id=1546069 i had check with 'live headers' seem no error. is it a memory leak issue in here??? as i still can post a large file(python-2.4.4.msi) to the page(>2MB). I still have result from win32traceutil window output but seem "truncated".... and browser reply with "The page cannot be displayed" please refer to attachment.....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:28 Message: Logged In: YES user_id=1546069 if I post a smaller file (<1MB), the semple seem work fine, but will fail on large file.... i found it('live headers') already, as priviously i try to find it via FF extension search only...:( those sample(extension_simple.py & advanced.py) only work with small file submit but not for bigggg file.... FYI: ==================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test2?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> ==================== new function define in extension_simple.py ----------------------- def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType print 'AvailableData :',ecb.AvailableData return 'csc' --------------------- please check the output in attachment....:) But this fail if you select a big file(>2MB)...... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 12:57 Message: Logged In: YES user_id=14198 Yep - in Aus - nearly bed time :) I suggest we try and get some of the samples working first. Let's just take this to email, but unless the samples work, your POST example isn't going to. I typed "live headers" into google and the first hit was the correct link from mozdev.org, as were most of the top 10 - I'm surprised you had trouble finding it. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 11:07 Message: Logged In: YES user_id=1546069 hi mark, i can't find "live headers" extension for FF. so i can't provide you the header info....:( BTW thank for your help... r u still in aust.?? (almost 7:30pm now...:( ) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:52 Message: Logged In: YES user_id=1546069 nope...non of them(I'm afraid).... actually we can POST file to iis server via "enctype='multipart/form-da". and we can read it out via isapi ecb.AvailableData, ecb.ContentType and with total bytes size ecb.TotalBytes. then we can use cgi module parse it after inject some isapi vars to os.enviroment(to make it become seem like CGI). Then I can expost all info in XML form via 4suit....:) I try to find "live headers" and try it again....:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 10:37 Message: Logged In: YES user_id=14198 I'm afraid I don't know how ISAPI is supposed to handle post data. You said you can't get the 'advanced' sample working - do any of them work? Maybe try the 'live headers' firefox extension - it may give you more clues what is going on. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:26 Message: Logged In: YES user_id=1546069 I try to dig further, found that ECB seem work and recieve post data, even i can redirect those data to win32traceutil window include http vars or "print >>ecb, data", but it always end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. ......???????!!!!!....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:13 Message: Logged In: YES user_id=1546069 hi mark, thank for your fast respond.....:) nothing in win32traceutil window(except "Tester dispatching ******"). i had try "advanced.py" as well, seem not work.... Attached with html form ===================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test1?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> =============================== BTW, Thank a lot for your help...:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 10:06 Message: Logged In: YES user_id=14198 Do you see a traceback in the win32traceutil window? Otherwise you will need to provide a sample which demonstrates the problem ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 09:54 Message: Logged In: YES user_id=1546069 some correction....: I can't compile it to any kind of isapi DLL as pywin32 ISAPI do...:( sorry for that...:( ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 09:52 Message: Logged In: YES user_id=1546069 i did samething with pyisapie mudule, it seem work. but i can compile it to any kind of dll. can i know what was happend in isapi module??? BTW, Thank a lot for those look in this.....:) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-24 05:25:42
|
Bugs item #1582744, was opened at 2006-10-23 19:44 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 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: win32 Group: None >Status: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: cheeng shu chin (cheengshuchin) Assigned to: Nobody/Anonymous (nobody) Summary: isapi extension seem Error for large file posting in iis Initial Comment: hi all, I try to submit a large file (2Mb+) to iis with pywin32 isapi extension via html form (POST method), but end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. This happen even with attached module "C:\Python24 \Lib\site-packages\isapi\test\extension_simple.py". The form with this "CONTENT_TYPE=multipart/form-data; boundary=---------------------------7d629bf20426" is it a limitation in isapi or some bug in it??? can someone help me on this??? ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2006-10-24 15:25 Message: Logged In: YES user_id=14198 Yes, as the ISAPI docs state, .AvailableData is only the available data, and ReadClient() must be used to read the rest. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:47 Message: Logged In: YES user_id=1546069 it seem like isapi ecb can return/extract all uploaded data from iis..and still lift some in the buffer. should i use ecb.ReadClient method in a loop to extract all data in buffer???? ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:40 Message: Logged In: YES user_id=1546069 i had check with 'live headers' seem no error. is it a memory leak issue in here??? as i still can post a large file(python-2.4.4.msi) to the page(>2MB). I still have result from win32traceutil window output but seem "truncated".... and browser reply with "The page cannot be displayed" please refer to attachment.....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 14:28 Message: Logged In: YES user_id=1546069 if I post a smaller file (<1MB), the semple seem work fine, but will fail on large file.... i found it('live headers') already, as priviously i try to find it via FF extension search only...:( those sample(extension_simple.py & advanced.py) only work with small file submit but not for bigggg file.... FYI: ==================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test2?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> ==================== new function define in extension_simple.py ----------------------- def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType print 'AvailableData :',ecb.AvailableData return 'csc' --------------------- please check the output in attachment....:) But this fail if you select a big file(>2MB)...... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 22:57 Message: Logged In: YES user_id=14198 Yep - in Aus - nearly bed time :) I suggest we try and get some of the samples working first. Let's just take this to email, but unless the samples work, your POST example isn't going to. I typed "live headers" into google and the first hit was the correct link from mozdev.org, as were most of the top 10 - I'm surprised you had trouble finding it. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 21:07 Message: Logged In: YES user_id=1546069 hi mark, i can't find "live headers" extension for FF. so i can't provide you the header info....:( BTW thank for your help... r u still in aust.?? (almost 7:30pm now...:( ) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:52 Message: Logged In: YES user_id=1546069 nope...non of them(I'm afraid).... actually we can POST file to iis server via "enctype='multipart/form-da". and we can read it out via isapi ecb.AvailableData, ecb.ContentType and with total bytes size ecb.TotalBytes. then we can use cgi module parse it after inject some isapi vars to os.enviroment(to make it become seem like CGI). Then I can expost all info in XML form via 4suit....:) I try to find "live headers" and try it again....:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 20:37 Message: Logged In: YES user_id=14198 I'm afraid I don't know how ISAPI is supposed to handle post data. You said you can't get the 'advanced' sample working - do any of them work? Maybe try the 'live headers' firefox extension - it may give you more clues what is going on. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:26 Message: Logged In: YES user_id=1546069 I try to dig further, found that ECB seem work and recieve post data, even i can redirect those data to win32traceutil window include http vars or "print >>ecb, data", but it always end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. ......???????!!!!!....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 20:13 Message: Logged In: YES user_id=1546069 hi mark, thank for your fast respond.....:) nothing in win32traceutil window(except "Tester dispatching ******"). i had try "advanced.py" as well, seem not work.... Attached with html form ===================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test1?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> =============================== BTW, Thank a lot for your help...:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 20:06 Message: Logged In: YES user_id=14198 Do you see a traceback in the win32traceutil window? Otherwise you will need to provide a sample which demonstrates the problem ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 19:54 Message: Logged In: YES user_id=1546069 some correction....: I can't compile it to any kind of isapi DLL as pywin32 ISAPI do...:( sorry for that...:( ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 19:52 Message: Logged In: YES user_id=1546069 i did samething with pyisapie mudule, it seem work. but i can compile it to any kind of dll. can i know what was happend in isapi module??? BTW, Thank a lot for those look in this.....:) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-24 04:47:07
|
Bugs item #1582744, was opened at 2006-10-23 09:44 Message generated for change (Comment added) made by cheengshuchin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: cheeng shu chin (cheengshuchin) Assigned to: Nobody/Anonymous (nobody) Summary: isapi extension seem Error for large file posting in iis Initial Comment: hi all, I try to submit a large file (2Mb+) to iis with pywin32 isapi extension via html form (POST method), but end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. This happen even with attached module "C:\Python24 \Lib\site-packages\isapi\test\extension_simple.py". The form with this "CONTENT_TYPE=multipart/form-data; boundary=---------------------------7d629bf20426" is it a limitation in isapi or some bug in it??? can someone help me on this??? ---------------------------------------------------------------------- >Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:47 Message: Logged In: YES user_id=1546069 it seem like isapi ecb can return/extract all uploaded data from iis..and still lift some in the buffer. should i use ecb.ReadClient method in a loop to extract all data in buffer???? ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:40 Message: Logged In: YES user_id=1546069 i had check with 'live headers' seem no error. is it a memory leak issue in here??? as i still can post a large file(python-2.4.4.msi) to the page(>2MB). I still have result from win32traceutil window output but seem "truncated".... and browser reply with "The page cannot be displayed" please refer to attachment.....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:28 Message: Logged In: YES user_id=1546069 if I post a smaller file (<1MB), the semple seem work fine, but will fail on large file.... i found it('live headers') already, as priviously i try to find it via FF extension search only...:( those sample(extension_simple.py & advanced.py) only work with small file submit but not for bigggg file.... FYI: ==================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test2?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> ==================== new function define in extension_simple.py ----------------------- def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType print 'AvailableData :',ecb.AvailableData return 'csc' --------------------- please check the output in attachment....:) But this fail if you select a big file(>2MB)...... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 12:57 Message: Logged In: YES user_id=14198 Yep - in Aus - nearly bed time :) I suggest we try and get some of the samples working first. Let's just take this to email, but unless the samples work, your POST example isn't going to. I typed "live headers" into google and the first hit was the correct link from mozdev.org, as were most of the top 10 - I'm surprised you had trouble finding it. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 11:07 Message: Logged In: YES user_id=1546069 hi mark, i can't find "live headers" extension for FF. so i can't provide you the header info....:( BTW thank for your help... r u still in aust.?? (almost 7:30pm now...:( ) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:52 Message: Logged In: YES user_id=1546069 nope...non of them(I'm afraid).... actually we can POST file to iis server via "enctype='multipart/form-da". and we can read it out via isapi ecb.AvailableData, ecb.ContentType and with total bytes size ecb.TotalBytes. then we can use cgi module parse it after inject some isapi vars to os.enviroment(to make it become seem like CGI). Then I can expost all info in XML form via 4suit....:) I try to find "live headers" and try it again....:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 10:37 Message: Logged In: YES user_id=14198 I'm afraid I don't know how ISAPI is supposed to handle post data. You said you can't get the 'advanced' sample working - do any of them work? Maybe try the 'live headers' firefox extension - it may give you more clues what is going on. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:26 Message: Logged In: YES user_id=1546069 I try to dig further, found that ECB seem work and recieve post data, even i can redirect those data to win32traceutil window include http vars or "print >>ecb, data", but it always end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. ......???????!!!!!....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:13 Message: Logged In: YES user_id=1546069 hi mark, thank for your fast respond.....:) nothing in win32traceutil window(except "Tester dispatching ******"). i had try "advanced.py" as well, seem not work.... Attached with html form ===================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test1?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> =============================== BTW, Thank a lot for your help...:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 10:06 Message: Logged In: YES user_id=14198 Do you see a traceback in the win32traceutil window? Otherwise you will need to provide a sample which demonstrates the problem ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 09:54 Message: Logged In: YES user_id=1546069 some correction....: I can't compile it to any kind of isapi DLL as pywin32 ISAPI do...:( sorry for that...:( ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 09:52 Message: Logged In: YES user_id=1546069 i did samething with pyisapie mudule, it seem work. but i can compile it to any kind of dll. can i know what was happend in isapi module??? BTW, Thank a lot for those look in this.....:) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 |
From: SourceForge.net <no...@so...> - 2006-10-24 04:40:23
|
Bugs item #1582744, was opened at 2006-10-23 09:44 Message generated for change (Comment added) made by cheengshuchin You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 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: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: cheeng shu chin (cheengshuchin) Assigned to: Nobody/Anonymous (nobody) Summary: isapi extension seem Error for large file posting in iis Initial Comment: hi all, I try to submit a large file (2Mb+) to iis with pywin32 isapi extension via html form (POST method), but end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. This happen even with attached module "C:\Python24 \Lib\site-packages\isapi\test\extension_simple.py". The form with this "CONTENT_TYPE=multipart/form-data; boundary=---------------------------7d629bf20426" is it a limitation in isapi or some bug in it??? can someone help me on this??? ---------------------------------------------------------------------- >Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:40 Message: Logged In: YES user_id=1546069 i had check with 'live headers' seem no error. is it a memory leak issue in here??? as i still can post a large file(python-2.4.4.msi) to the page(>2MB). I still have result from win32traceutil window output but seem "truncated".... and browser reply with "The page cannot be displayed" please refer to attachment.....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-24 04:28 Message: Logged In: YES user_id=1546069 if I post a smaller file (<1MB), the semple seem work fine, but will fail on large file.... i found it('live headers') already, as priviously i try to find it via FF extension search only...:( those sample(extension_simple.py & advanced.py) only work with small file submit but not for bigggg file.... FYI: ==================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test2?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> ==================== new function define in extension_simple.py ----------------------- def test2(self, ecb): print 'TotalBytes :',ecb.TotalBytes print 'AvailableBytes :',ecb.AvailableBytes print 'Method :',ecb.Method print 'ContentType :',ecb.ContentType print 'AvailableData :',ecb.AvailableData return 'csc' --------------------- please check the output in attachment....:) But this fail if you select a big file(>2MB)...... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 12:57 Message: Logged In: YES user_id=14198 Yep - in Aus - nearly bed time :) I suggest we try and get some of the samples working first. Let's just take this to email, but unless the samples work, your POST example isn't going to. I typed "live headers" into google and the first hit was the correct link from mozdev.org, as were most of the top 10 - I'm surprised you had trouble finding it. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 11:07 Message: Logged In: YES user_id=1546069 hi mark, i can't find "live headers" extension for FF. so i can't provide you the header info....:( BTW thank for your help... r u still in aust.?? (almost 7:30pm now...:( ) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:52 Message: Logged In: YES user_id=1546069 nope...non of them(I'm afraid).... actually we can POST file to iis server via "enctype='multipart/form-da". and we can read it out via isapi ecb.AvailableData, ecb.ContentType and with total bytes size ecb.TotalBytes. then we can use cgi module parse it after inject some isapi vars to os.enviroment(to make it become seem like CGI). Then I can expost all info in XML form via 4suit....:) I try to find "live headers" and try it again....:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 10:37 Message: Logged In: YES user_id=14198 I'm afraid I don't know how ISAPI is supposed to handle post data. You said you can't get the 'advanced' sample working - do any of them work? Maybe try the 'live headers' firefox extension - it may give you more clues what is going on. ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:26 Message: Logged In: YES user_id=1546069 I try to dig further, found that ECB seem work and recieve post data, even i can redirect those data to win32traceutil window include http vars or "print >>ecb, data", but it always end out with "The page cannot be displayed" for IE and "server connection reset" for firefox. ......???????!!!!!....:) ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 10:13 Message: Logged In: YES user_id=1546069 hi mark, thank for your fast respond.....:) nothing in win32traceutil window(except "Tester dispatching ******"). i had try "advanced.py" as well, seem not work.... Attached with html form ===================== <HTML> <HEAD> <TITLE>Post Data</TITLE> <META NAME="generator" CONTENT="ToniArts EasyHtml v.2.2"> </HEAD> <BODY> <FORM method="POST" action="http://localhost/pyisapi_test/test1?debug=1" enctype='multipart/form-data'> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[1] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[2] cols=35 rows=7></TEXTAREA> <TEXTAREA name=csc[3] cols=35 rows=7></TEXTAREA> <input type="file" name="filen0" > <input type="file" name="filen1" > <INPUT type="Submit" value="Submit"> </FORM> </BODY> </HTML> =============================== BTW, Thank a lot for your help...:) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2006-10-23 10:06 Message: Logged In: YES user_id=14198 Do you see a traceback in the win32traceutil window? Otherwise you will need to provide a sample which demonstrates the problem ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 09:54 Message: Logged In: YES user_id=1546069 some correction....: I can't compile it to any kind of isapi DLL as pywin32 ISAPI do...:( sorry for that...:( ---------------------------------------------------------------------- Comment By: cheeng shu chin (cheengshuchin) Date: 2006-10-23 09:52 Message: Logged In: YES user_id=1546069 i did samething with pyisapie mudule, it seem work. but i can compile it to any kind of dll. can i know what was happend in isapi module??? BTW, Thank a lot for those look in this.....:) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582744&group_id=78018 |