Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird error #5

Open
rkarlsba opened this issue Dec 27, 2018 · 23 comments
Open

Weird error #5

rkarlsba opened this issue Dec 27, 2018 · 23 comments

Comments

@rkarlsba
Copy link

Seems there's a typo of sorts in the latest version in git

Roys-MacBook-Pro-1840:remix-of-Russian-Doll-Maze-Puzzle-Box roy$ ./main.py
Traceback (most recent call last):
File "./main.py", line 516, in
version = scad_version()
File "./main.py", line 77, in scad_version
return (int(ver[0]), int(ver[1]), int(ver[2])) if ver else ()
ValueError: invalid literal for int() with base 10: "b''"
Roys-MacBook-Pro-1840:remix-of-Russian-Doll-Maze-Puzzle-Box roy$

Cowboy-fix:

diff --git a/main.py b/main.py
index bfb4680..c4946fe 100755
--- a/main.py
+++ b/main.py
@@ -74,6 +74,8 @@ def scad_version():
cmd = [openscad(), "--version"]
ver=sp.run(cmd,capture_output=True).stdout
ver=str(ver).replace("\r","").replace("b'OpenSCAD version ","").replace("\n'","").replace("-",".").split(".")
+# OpenSCAD version 2015.03-3

  • return (2015,3,3)
    return (int(ver[0]), int(ver[1]), int(ver[2])) if ver else ()

#runs the scad
Roys-MacBook-Pro-1840:remix-of-Russian-Doll-Maze-Puzzle-Box roy$

@jmerc77
Copy link
Owner

jmerc77 commented Dec 29, 2018

problem is here:
ver=str(ver).replace("\r","").replace("b'OpenSCAD version ","").replace("\n'","").replace("-",".").split(".")

should be:
ver=str(ver).replace("\r","").replace("b'OpenSCAD version ","").replace("\n'","").replace("-",".").split(".")

try re-downloading or manually fix it as it is correct on the repo page and in my backup.

@rkarlsba
Copy link
Author

erm - those two mentioned lines are identical. I just tried to checkout main.py to remove my cowboy fix, and same error occurs.

@jmerc77
Copy link
Owner

jmerc77 commented Dec 29, 2018

i meant:
ver=str(ver).replace("\r","").replace("b'OpenSCAD version ","").replace("\n'","").replace("-",".").split(".")

(double backslash)

@jmerc77
Copy link
Owner

jmerc77 commented Dec 29, 2018

ummmm... why the **** are they not posting double backslashes properly!

weirderer

@rkarlsba
Copy link
Author

rkarlsba commented Dec 29, 2018 via email

@jmerc77
Copy link
Owner

jmerc77 commented Dec 29, 2018

hmmm... maybe it is not liking the mac. it would be helpfull to know if it is doing that on a windows from your end too. i suspect it needs more escapement for the '.

@rkarlsba
Copy link
Author

rkarlsba commented Dec 29, 2018 via email

@rkarlsba
Copy link
Author

rkarlsba commented Dec 29, 2018 via email

@jmerc77
Copy link
Owner

jmerc77 commented Dec 29, 2018

oh. F'' must be a 3.7 thing. i'll work on that.

@jmerc77
Copy link
Owner

jmerc77 commented Dec 29, 2018

think I got it. took a lot though.

@rkarlsba
Copy link
Author

rkarlsba commented Dec 29, 2018 via email

@rkarlsba
Copy link
Author

rkarlsba commented Dec 29, 2018 via email

@jmerc77
Copy link
Owner

jmerc77 commented Dec 29, 2018

ok... traded run(...) for Popen(...). still works on my end how about yours?

@rkarlsba
Copy link
Author

rkarlsba commented Dec 29, 2018 via email

@jmerc77
Copy link
Owner

jmerc77 commented Dec 29, 2018

oh! aha! just what I needed!
decode("utf-8")

@rkarlsba
Copy link
Author

rkarlsba commented Dec 30, 2018 via email

@jmerc77
Copy link
Owner

jmerc77 commented Mar 20, 2019

made many changes since then. if I were to test on linux, I'd rather do it on my end with VM. I was having issues getting it to work. some of which were due to slow internet. but ill look into it soon because I changed internet providers.

@jmerc77
Copy link
Owner

jmerc77 commented Mar 20, 2019

btw, what were the options used? that seems to help with testing on my end.

@rkarlsba
Copy link
Author

I don't remember - it's some months ago, and I found https://github.com/revk/PuzzleBox working better.

@jmerc77
Copy link
Owner

jmerc77 commented Aug 1, 2020

ver[2] was unused and was causing problems. so i removed that. seems better now.

@jmerc77
Copy link
Owner

jmerc77 commented Jan 25, 2021

the version check has been an on going problem. only the year is needed so I did an update. hope it works now.

@jmerc77
Copy link
Owner

jmerc77 commented Jun 24, 2023

Ok. its been a while as iv'e been working on other things here and there. it looks like it is not working well on linux/mac. for those having issues, please retest on windows so I can see if its a linux thing or an unknown bug over all. also, it would be helpful to have someone assist in debugging on linux and especially mac. i am not a mac user, and this is untested on linux. while i could test on a VM, i don't know much about linux as far as programing. the most i've done in linux was with the RPI and its OS, but only basic stuff.
edit: be sure to use the same openSCAD version accross your tests to see if maybe there's an issue with version check etc.

@rkarlsba
Copy link
Author

Please see my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants