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

TypeError: can only concatenate str (not "int") to str #143

Closed
zenziwerken opened this issue Aug 25, 2022 · 4 comments · Fixed by #147
Closed

TypeError: can only concatenate str (not "int") to str #143

zenziwerken opened this issue Aug 25, 2022 · 4 comments · Fixed by #147
Labels
bug Something isn't working

Comments

@zenziwerken
Copy link
Contributor

Tested under Windows 10 running in VirtualBox.

Log Output / Stack Trace

File "C:\Users\Daniel\anaconda3\envs\gdal-user\lib\site-packages\wahoomc\osm_maps_functions.py", line 668, in create_map_files cmd.append('threads=' + threads)
TypeError: can only concatenate str (not "int") to str

Correction could be

cmd.append('threads=' + threads)
cmd.append(f'threads={threads}')

@zenziwerken zenziwerken added the bug Something isn't working label Aug 25, 2022
@treee111
Copy link
Owner

Thanks for posting this issue!
I wonder why this was not reported before. I hadn't this myself running on Windows 10.

  • Maybe because running in a VM is different from a "normal" OS?
    • Defaulting threads?
    • Different Python versions?

But as this is a syntax error it should be reproducable...

@zenziwerken
Copy link
Contributor Author

Problem does not show on 'normal' Windows. Probably this line does not give suitable result in VM:
line 646: threads = str(multiprocessing.cpu_count() - 1)

Could be circumvented with a try-construction

@masc4ii
Copy link
Contributor

masc4ii commented Sep 26, 2022

After this line, there is an code error:

# Number of threads to use in the mapwriter plug-in
        threads = str(multiprocessing.cpu_count() - 1)
        if int(threads) < 1:
            threads = 1

Last line must be
threads = '1'

@treee111
Copy link
Owner

Hi you two!
I looked deeper into it and found the mistake with your comments.
You are welcome to read and test #147 if this works for you.
Would be lovely if you could test it in your VM @zenziwerken, created a PyPI version for easy install :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants