I am getting a TypeError when I drag and drop files onto a widget in wxPython Phoenix, but only to stdout. It doesn’t actually cause the script to stop. Here’s the error:
builtins.TypeError: invalid result from MyFileDropTarget.OnDropFiles(), an integer is required (got type NoneType)
Interestingly, I get pretty much the same error with a TextDropTarget as well. PyDropTarget’s work fine for me though.
Mike
···
On Sunday, November 27, 2016 at 2:06:53 PM UTC-6, mike wrote:
Hi,
I am getting a TypeError when I drag and drop files onto a widget in wxPython Phoenix, but only to stdout. It doesn’t actually cause the script to stop. Here’s the error:
I think it's probably complaining because you're not returning a bool in OnDropFiles.
Scott
···
On Sun, 27 Nov 2016, Mike Driscoll wrote:
Hi,
I am getting a TypeError when I drag and drop files onto a widget in
wxPython Phoenix, but only to stdout. It doesn't actually cause the script
to stop. Here's the error:
builtins.TypeError: invalid result from MyFileDropTarget.OnDropFiles(), an
integer is required (got type NoneType)
My code is
here: drop_file_target.py · GitHub
This code worked fine in wxPython 3.0 Classic. Interestingly the code works
as expected other than the odd output that goes to stdout.
Does anyone know why this is happening? I am running Phoenix on Windows 7
with Python 3.5.
On Sunday, November 27, 2016 at 5:28:04 PM UTC-6, Scott Talbert wrote:
On Sun, 27 Nov 2016, Mike Driscoll wrote:
> Hi,
>
> I am getting a TypeError when I drag and drop files onto a
widget in
> wxPython Phoenix, but only to stdout. It doesn't actually
cause the script
> to stop. Here's the error:
>
> builtins.TypeError: invalid result from
MyFileDropTarget.OnDropFiles(), an
> integer is required (got type NoneType)
> My code is
>
here: drop_file_target.py · GitHub
>
> This code worked fine in wxPython 3.0 Classic. Interestingly
the code works
> as expected other than the odd output that goes to stdout.
>
> Does anyone know why this is happening? I am running Phoenix
on Windows 7
> with Python 3.5.
I think it's probably complaining because you're not returning a
bool in
OnDropFiles.
Scott
That does seem to be the issue. Do you know if that is documented somewhere?
I missed that somehow. Thanks for taking the time to find that.
Mike
···
On Mon, Nov 28, 2016 at 10:27 AM, Scott Talbert <swt@techie.net> wrote:
On Mon, 28 Nov 2016, Mike Driscoll wrote:
On Sunday, November 27, 2016 at 5:28:04 PM UTC-6, Scott Talbert wrote:
On Sun, 27 Nov 2016, Mike Driscoll wrote:
> Hi,
>
> I am getting a TypeError when I drag and drop files onto a
widget in
> wxPython Phoenix, but only to stdout. It doesn't actually
cause the script
> to stop. Here's the error:
>
> builtins.TypeError: invalid result from
MyFileDropTarget.OnDropFiles(), an
> integer is required (got type NoneType)
> My code is
>
here: https://gist.github.com/driscollis/a71018bc138a4c1974b
ca90e30d9f0e4
>
> This code worked fine in wxPython 3.0 Classic. Interestingly
the code works
> as expected other than the odd output that goes to stdout.
>
> Does anyone know why this is happening? I am running Phoenix
on Windows 7
> with Python 3.5.
I think it's probably complaining because you're not returning a
bool in
OnDropFiles.
Scott
That does seem to be the issue. Do you know if that is documented
somewhere?