Arch Schedule Py3 Problem

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
furti
Posts: 343
Joined: Mon Nov 27, 2017 5:27 pm

Arch Schedule Py3 Problem

Postby furti » Mon Sep 10, 2018 6:58 pm

Steps to reproduce:

1. Create Wall
2. Click "Arch Schedule" Button
3. Set Description to "Test"
4. Set Value to "object.Shape.Area"
5. Set Unit to "m^2"
6. Click "OK"

Now the following Error Occurs:

Code: Select all

Traceback (most recent call last):
  File "C:\Meine Daten\freecad\FreeCAD_0.18.14575_Conda_Py3QT5-WinVS2015_x64\FreeCAD_0.18.14575_Conda_Py3QT5-WinVS2015_x64\Mod\Arch\ArchSchedule.py", line 112, in execute
    obj.Result.set("A"+str(i+2),obj.Description[i].encode("utf8"))
<class 'TypeError'>: set() argument 2 must be str, not bytes
Tested with:

Code: Select all

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14575 (Git)
Build type: Release
Branch: master
Hash: a624fee2c27bbbb869df6a8ce40438953a282a8c
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)
User avatar
furti
Posts: 343
Joined: Mon Nov 27, 2017 5:27 pm

Re: Arch Schedule Py3 Problem

Postby furti » Tue Sep 11, 2018 5:13 pm

Created issue in bug tracker for this https://www.freecadweb.org/tracker/view.php?id=3590
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: Arch Schedule Py3 Problem

Postby looo » Wed Oct 17, 2018 7:44 am

I have difficulties reproducing this. Can you explain how you setthe Value to "object.Shape.Area" and change the unit in arch-shedule.

I don't see these options in the task-panel:
Bildschirmfoto von 2018-10-17 09-43-05.png
Bildschirmfoto von 2018-10-17 09-43-05.png (17.95 KiB) Viewed 424 times
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: Arch Schedule Py3 Problem

Postby looo » Wed Oct 17, 2018 10:37 am

anyway the reported problem should be fixed with git commit 1e6818b6fbf86ad08d8fc85252dddcae8891dd54
User avatar
furti
Posts: 343
Joined: Mon Nov 27, 2017 5:27 pm

Re: Arch Schedule Py3 Problem

Postby furti » Wed Oct 17, 2018 11:15 am

looo wrote:
Wed Oct 17, 2018 7:44 am
I have difficulties reproducing this
Your screenshot looks like you tested with arch survey https://www.freecadweb.org/wiki/Arch_Survey.
I had the problem with https://www.freecadweb.org/wiki/Arch_Schedule.

Will test when a new build with the fix is available :)
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: Arch Schedule Py3 Problem

Postby looo » Thu Oct 18, 2018 9:55 am

furti wrote:
Wed Oct 17, 2018 11:15 am
Your screenshot looks like you tested with arch survey https://www.freecadweb.org/wiki/Arch_Survey.
I see. I tested now with arch-schedule and it seems to fail now at another point. But I will wait for your test-report as I really have not much idea how to use these tools.
User avatar
furti
Posts: 343
Joined: Mon Nov 27, 2017 5:27 pm

Re: Arch Schedule Py3 Problem

Postby furti » Sat Oct 20, 2018 1:40 pm

looo wrote:
Thu Oct 18, 2018 9:55 am
But I will wait for your test-report
Unfortunately it fails on a different location but still the same cause. Still a Byte like/String problem.

Code: Select all

Traceback (most recent call last):
  File "C:\Meine Daten\freecad\FreeCAD_0.18_Py3\Mod\Arch\ArchSchedule.py", line 214, in execute
    unit = ustr.replace("²","^2")
<class 'TypeError'>: a bytes-like object is required, not 'str'

Tested with:

Code: Select all

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14993 (Git)
Build type: Release
Branch: master
Hash: 1e6818b6fbf86ad08d8fc85252dddcae8891dd54
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: Arch Schedule Py3 Problem

Postby looo » Tue Oct 23, 2018 1:44 pm

Sry, these unicode errors are really annoying. I will have a look at this at the weekend.
User avatar
yorik
Site Admin
Posts: 12011
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels, Belgium
Contact:

Re: Arch Schedule Py3 Problem

Postby yorik » Tue Oct 23, 2018 2:05 pm

And the funny part is that py3 is supposed to simplify all this :roll: What's the point to say "now str == unicode" if all the time there are now byte != str problems... </end of rant>

I really need to start using the py3 version too now so we get all these things processed faster.
User avatar
looo
Posts: 3431
Joined: Mon Nov 11, 2013 5:29 pm

Re: Arch Schedule Py3 Problem

Postby looo » Tue Oct 23, 2018 2:28 pm

yorik wrote:
Tue Oct 23, 2018 2:05 pm
And the funny part is that py3 is supposed to simplify all this :roll:
I guess the only difficult thing is supporting py2 and py3. Supporting only one of these versions is not that much trouble. And yes, the str-change in py3 introduced as much troubles as possible with as less improvement as possible.