Menu

#633 decimal.Decimal cannot be converted to a COM VARIENT

closed-fixed
nobody
com (105)
5
2013-04-01
2013-03-25
Vernon Cole
No

I simply clipped my original question and Roger's response from the email to get this on the tracker.
--
Vernon

Roger Upole rupole@hotmail.com via python.org

7:28 AM (7 hours ago)

to python-win32
Looks like it's due to way the type is name-checked (oleargs.cpp, line 263):

else if (strcmp(obj->ob_type->tp_name, "Decimal")==0)

That doesn't work in 3.3 anymore. However, the function it calls to do the
actual conversion has already been modified to use an isinstance check
instead so it shouldn't be too difficult to fix.

Roger

"Vernon D. Cole" <vernondcole@gmail.com> wrote in message news:CAH-ZgAcOXMUHR+8_gsHS89h6cURzLovhUnauMsnz=bhjsFnpBw@mail.gmail.com...
> Guys:
> I am starting work on an upgrade to adodbapi -- so I set up a new
> improved test layout and started
> running some baseline tests before changing any application code. I just
> tripped across this one: I don't know whether it is actually new or whether
> my new tests exposed something which has been there a long time and never
> noticed. The interesting thing is that this does not occur on Python 2
> (whether or not I am running 64 bit Python) -- I only see it on Python 3.3
> 64 bit. I have not tried any other Python 3 versions yet.
>
> I am ready to provide more or better (small example) test cases if that
> would help, but if one of you can see what's wrong from just this clip, I
> will spend my time elsewhere. What other info would be useful when I
> submit the ticket?
> --
> Vernon Cole
>
> [Note: this is the hg tip from sf.net/projects/adodbapi -- not the copy in
> /pywin32. I don't want to update that until this is completely working. ]
>
> <clipped console dump follows>
> C:\Users\vernon\PycharmProjects\adodbapi\test>c:\python33\python.exe
> adodbapitest.py
> 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit
> (AMD64)]
> node=z-PC: is64bit.os()= True, is64bit.Python()= True
> [...clip...]
> ERROR: testDataTypeMoney (__main__.TestADOwithAccessDB)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File
> "c:\users\vernon\appdata\local\temp\adotest_k0ojue\adodbapi\adodbapi.py",
> line 969, in _buildADOparameterList
> _configure_parameter(p, value, self.parameters_known)
> File
> "c:\users\vernon\appdata\local\temp\adotest_k0ojue\adodbapi\adodbapi.py",
> line 403, in _configure_parameter
> p.Value = value
> File "c:\python33\lib\site-packages\win32com\client\dynamic.py", line
> 560, in
> __setattr__
> self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, value)
> TypeError: Objects of type 'decimal.Decimal' can not be converted to a COM
> VARIANT
> </clip>
>

Discussion

  • Roger Upole

    Roger Upole - 2013-04-01

    This is fixed now.

     
  • Roger Upole

    Roger Upole - 2013-04-01
    • status: open --> closed-fixed