I have problems while reading file(utf-8) on release mode.
My code is like below.
Fixed code is as below.
However, I don't know why it is fixed..
I just switch wstring to string(char).
Could you explain why it is fixed?
The file which causes exception is over 1MB csv file.
My tbbmalloc_proxy.h is as below.
Thank you for reading.
Before you rate me, I must say that I read almost every answer on this site about who had my same problem, but i found no answer.
For example there the one who asked the question accepted the first answer, but copy-pasting the code in the answer the same error was raised.
An other example there where is linked this video, which doesn't explain much, but there no error is raised, instead of my code when I copied it from the video. (he doesn't write .exe, so probably an error would be found in his code too)
This one has exactly my same problem, so it would be perfect, but no answer was accepted.
Here's the last line of the error:
selenium.common.exceptions.WebDriverException: Message: 'chrome.exe %s' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
At the end of the exception message there's a link, which says they migrated to another site.
The error message here:
FileNotFoundError: [WinError 2] Impossibile trovare il file specificato
During handling of the above exception, another exception occurred:
#Something else beetwen
selenium.common.exceptions.WebDriverException: Message: 'chrome.exe %s' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
Here's the beginning of my code:
from selenium import webdriver
chrome_path = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
driver = webdriver.Chrome(executable_path=chrome_path)
I'm sure the path is correct, 'cause I copy-pasted it from the chrome.exe properties.
I also tried it without %s, and it raises a different error:
selenium.common.exceptions.WebDriverException: Message: Service C:/Program Files (x86)/Google/Chrome/Application/chrome.exe unexpectedly exited. Status code was: 0
Can someone help explaining me what's wrong?
Thanks
EDIT
I searched with file explorer for "chromedriver", and nothing was found.
You can try as following
driver = webdriver.Chrome(executable_path=r'Path_to_chrome_Driver\\chromedriver.exe')
You are locating chrome browser exe location. Please download chrome driver for selenium Chromedriver. Then enter the chrome driver location.
Note: Make sure you have downloaded the correct chromedriver based on your chrome browser version.
As I see your path is to Chrome (browser) exe file instead of chromedriver.exe used by Selenium
So I get that google colab crashes when using cv2.imshow for displaying images. Google colab has its own solution for replacing that function and google.colab.patches import cv2_imshow can be used as a replacement for displaying images.
However, I did notice that colab raises a DisabledFunctionError when I try using cv2.imshow. This led me to think that maybe I can try catching that error using 'Try and Except' block. But in order to do that DisabledFunctionError must be defined as a custom error in python. So I wrote an exception class to define that error:
class DisabledFunctionError(Exception):
pass
Now having done that I should assume that an error can be handled using try and except block as
follows:
try:
cv2.imshow(frame, image)
except DisabledErrorFunction:
print('Error handled')
But, to my surprise, colab still raises an exception and its not caught by the try and except block. This behavior seems strange to me. Am I missing something here? Is this behavior due to colab?
I have a lot of images to handle, and it is possible that some of the images have some problems to open. So I want to handle possible exceptions in my python script. The problem is I do not know what kind of exceptions might be raised during the process of opening an image. This is my script for exception handling:
from PIL import Image
# all_im_path is a list containing all the image path
for path in all_im_path:
try:
im = Image.open(path)
ratio = float(im.width) / float(im.height)
ratios.append(ratio)
im.close()
except:
continue
I know from other post that catching a bare exception is a bad practice. But I do not know beforehand which exception to raise. So my question is how to improve this code. Any suggestions?
I have problem with printing pdf files in odoo 8
Every time I hit print it give me this massage
Report (PDF)
Wkhtmltopdf failed (error code: -11). Message: Error: Failed loading page http:///tmp/report.tmp.yWknzr/report.footer.tmp.UYfr2X.html?page=1§ion=&sitepage=1&title=&subsection=&frompage=1&subsubsection=&isodate=2017-04-17&topage=1&doctitle=&sitepages=1&webpage=/tmp/report.tmp.yWknzr/report.body.tmp.QXmK5d.html&time=11:47 AM&date=4/17/17 (sometimes it will work just to ignore this error with --load-error-handling ignore)
QPaintDevice: Cannot destroy paint device that is being painted
I have tried the solutions in this topic
https://www.odoo.com/nl_NL/forum/help-1/question/wkhtmltopdf-failed-error-code-11-75795
And it is still not working any one have a solution to this problem?
Thank you in advance