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

No Downloads and Errors in code window #10

Open
Davierooker opened this issue Dec 13, 2020 · 4 comments
Open

No Downloads and Errors in code window #10

Davierooker opened this issue Dec 13, 2020 · 4 comments

Comments

@Davierooker
Copy link

Running Windows 10, can get the app loaded and select area but no download.
Exception happened during processing of request from ('127.0.0.1', 11709)
Traceback (most recent call last):
File "C:\Users\cwilson.KORBEN\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 639, in process_request_thread
self.finish_request(request, client_address)
File "C:\Users\cwilson.KORBEN\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\cwilson.KORBEN\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 696, in init
self.handle()
File "C:\Users\cwilson.KORBEN\AppData\Local\Programs\Python\Python36\lib\http\server.py", line 418, in handle
self.handle_one_request()
File "C:\Users\cwilson.KORBEN\AppData\Local\Programs\Python\Python36\lib\http\server.py", line 406, in handle_one_request
method()
File "server.py", line 153, in do_POST
self.writerByType(outputType).addMetadata(lock, os.path.join("output", outputDirectory), filePath, outputFile, "Map Tiles Downloader via AliFlux", "png", boundsArray, centerArray, minZoom, maxZoom, "mercator", 256 * outputScale)
AttributeError: 'NoneType' object has no attribute 'addMetadata'

@apaleja
Copy link

apaleja commented Jul 1, 2021

I am also getting this same error. did you find any solution ?

@Dawson-Jiang
Copy link

you can print outputType value for check reason

@RussellTaylor83
Copy link

RussellTaylor83 commented Sep 13, 2021

I have this problem under Ubuntu and not Windows. In server.py, line 133 you'll see

outputDirectory = str(postvars['outputDirectory'][0])

If you print out the value with the following you get different values under Windows and Ubuntu

print("postvars['outputDirectory'][0]: " + str(postvars['outputDirectory'][0]))

Under ubuntu this gives b'{timestamp}' and under windows it gives the correct {timestamp}

I'm not a Python guy but it seems str conversions are handled differently under each OS. On a quick Google search it's something to do with being a byte array and not understanding the character encoding when using str(). Anyway in Ubuntu I swapped out that block of code for this

elif parts.path == '/start-download':
	outputType = str(postvars['outputType'][0], 'utf-8')
	outputScale = int(postvars['outputScale'][0])
	outputDirectory = str(postvars['outputDirectory'][0], 'utf-8')
	outputFile = str(postvars['outputFile'][0], 'utf-8')
	minZoom = int(postvars['minZoom'][0])
	maxZoom = int(postvars['maxZoom'][0])
	timestamp = int(postvars['timestamp'][0])
	bounds = str(postvars['bounds'][0], 'utf-8')
	boundsArray = map(float, bounds.split(","))
	center = str(postvars['center'][0], 'utf-8')
	centerArray = map(float, center.split(","))

Note all str functions having the second argument passed in. Anyway there is probably a correct way to fix this, but this got it running for me for now.

If I get time to figure it out properly I'll post back.

@AliFlux
Copy link
Owner

AliFlux commented Oct 2, 2021

I'm currently porting the code to Electron since there are too many python issues including version confusions and performance hits. The v2 will be significantly faster and easier to run

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

5 participants