I am encountering the same issue after upgrading Python. This started happening approx. 4 weeks ago.
Although I was using Anaconda, I uninstalled Anaconda, miniconda, Homebrew and installed the official 3.6 version from https://www.python.org/downloads/mac-osx/ and a clean venv and still encounbtering the issue. I’m stumped but this leads me to believe it’s not Anaconda related.
Mostly raising exceptions in werkzeug, googleapiclient and oauth2client.
Setup: Mac OS X latest version, Pycharm latest version. Libraries are latest version as of this moment (clean venv, no version specified in requirements.txt. file)
I’ve posted a SO question if anyone wants to contribute. https://stackoverflow.com/questions/50055316/flask-upgrade-lots-of-exception-ignored-in-messages-in-console
127.0.0.1 - - [24/May/2018 15:24:12] "GET /intro HTTP/1.1" 200 - Exception ignored in: <generator object url_parse.<locals>.<genexpr> at 0x11521aa98> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/werkzeug/urls.py", line 428, in <genexpr> if not rest or any(c not in s('0123456789') for c in rest): SystemError: error return without exception set Environment detected = MACBOOK PRO url=http://localhost:5000/setTimeOffset?time_offset=-7 None None None None None None Environment detected = MACBOOK PRO session id=16c3172a-c645-4198-baf2-3bae1d1946ad None None None None None None Access token expires in 0:59:59.988708 Exception ignored in: <generator object _findPageTokenName.<locals>.<genexpr> at 0x11521a410> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/googleapiclient/discovery.py", line 1165, in <genexpr> if tokenName in fields), None) SystemError: error return without exception set Exception ignored in: <generator object _findPageTokenName.<locals>.<genexpr> at 0x11521a410> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/googleapiclient/discovery.py", line 1165, in <genexpr> if tokenName in fields), None) SystemError: error return without exception set Exception ignored in: <generator object _findPageTokenName.<locals>.<genexpr> at 0x11521a410> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/googleapiclient/discovery.py", line 1165, in <genexpr> if tokenName in fields), None) SystemError: error return without exception set Exception ignored in: <generator object _findPageTokenName.<locals>.<genexpr> at 0x11521a410> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/googleapiclient/discovery.py", line 1165, in <genexpr> if tokenName in fields), None) SystemError: error return without exception set Exception ignored in: <generator object _findPageTokenName.<locals>.<genexpr> at 0x11521a410> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/googleapiclient/discovery.py", line 1165, in <genexpr> if tokenName in fields), None) SystemError: error return without exception set Exception ignored in: <generator object _findPageTokenName.<locals>.<genexpr> at 0x11521a410> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/googleapiclient/discovery.py", line 1165, in <genexpr> if tokenName in fields), None) SystemError: error return without exception set Exception ignored in: <generator object wrap_http_for_auth.<locals>.new_request.<locals>.<genexpr> at 0x115378f10> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/oauth2client/transport.py", line 169, in <genexpr> if all(getattr(body, stream_prop, None) for stream_prop in SystemError: error return without exception set Access token expires in 0:59:59.994491 Exception ignored in: <generator object wrap_http_for_auth.<locals>.new_request.<locals>.<genexpr> at 0x1156e3c50> Traceback (most recent call last): File "/Project/venv/lib/python3.6/site-packages/oauth2client/transport.py", line 169, in <genexpr> if all(getattr(body, stream_prop, None) for stream_prop in SystemError: error return without exception set
You should have a syntax error ‘SyntaxError: EOL while scanning string literal‘ due to your fields variable, which should be a list.
You have a logical error that prevents the row from being updated within the Update Cursor unless the conditional is satisfied; disregard if that is intentional.
# Original
fields = "CREATE_BY", "CHANGE_BY" # Not a list as would be expected
for fc in fcList:
if len(arcpy.ListFields(fc,"CREATE_BY"))>0:
with arcpy.da.UpdateCursor(fc, fields) as cursor:
for row in cursor:
if row[0] == "domain" + "\" + user_old:
row[0] = "domain" + "\" + user_new
if row[1] == "domain" + "\" + user_old: #<--- Conditional
row[1] = "domain" + "\" + user_new
cursor.updateRow(row) # <------ Here
arcpy.AddWarning("field in " + fc + " updated")
# Updated
fields = ["CREATE_BY", "CHANGE_BY"] # Is a list, and is expected
for fc in fcList:
if len(arcpy.ListFields(fc,"CREATE_BY"))>0:
with arcpy.da.UpdateCursor(fc, fields) as cursor:
for row in cursor:
if row[0] == "domain" + "\" + user_old:
row[0] = "domain" + "\" + user_new
if row[1] == "domain" + "\" + user_old:
row[1] = "domain" + "\" + user_new
arcpy.AddWarning("field in " + fc + " updated")
cursor.updateRow(row) # <------ Will update if first cond. True
"""The original would only update your row when the conditional below is True:
if row[1] == "domain" + "\" + user_old:
The cursor.updateRow(row) was placed inside of the first conditional
since it is assumed that you'd like it to only update when an update
occurs."""
As for the ‘SystemError: error return without exception set’ error, this error is fleeting, and I have not figured out the exact reasoning for it either, but what you will likely find is that the version you were accessing has a schema lock on it. The only way to remove this lock is to have your SDE admin disconnect it, or close out of ArcMap, and possibly kill the ArcMap.exe process in the Task Manager.
I have found that this schema lock will happen when you are in an edit session through ArcMap’s Editor Toolbar, and you try to run the arcpy.da.Editor tools on that versioned data, or the opposite, you run arcpy.da.Editor, then try to use the Editor Toolbar. I have yet to figure out the best way to be able to view the changes, and completely prevent this lock from occurring.
On another note, after a successful run of your script, if your Table of Contents in ArcMap is set to the versioned data source of your update, you can go up to the Versioning Toolbar, and click on Refresh, and it will pull your changes to be viewed, in or out of a Editor Toolbar Edit Session.
Бот парсит кучу инфы и выдаёт её в виде картинки с помощью модуля PILLOW
Кусок кода:
namecoin = open("result"+str(cid)+".txt").read()
tagcoin = open("result2"+str(cid)+".txt").read()
btcprofit = open("result3"+str(cid)+".txt").read()
estrew = open("result4"+str(cid)+".txt").read()
fiatprofit = open("result5"+str(cid)+".txt").read()
txt = Image.open("750.png")
textfont = ImageFont.truetype("font2.ttf", 18)
numberfont = ImageFont.truetype("fontnumber.ttf", 20)
headerfont = ImageFont.truetype("font2.ttf", 27)
d = ImageDraw.Draw(txt)
d.text((20,180), namecoin, font=textfont, fill=(0,0,0,255))
d.text((200,180), tagcoin, font=textfont, fill=(0,0,0,255), align="center")
d.text((270,44), numcards, font=headerfont, fill=(0,0,0,255))
d.text((300,180), estrew, font=numberfont, fill=(0,0,0,255), spacing=3, align="center")
d.text((450,180), btcprofit, font=numberfont, fill=(0,0,0,255), spacing=3, align="center")
d.text((570,180), fiatprofit, font=numberfont, fill=(0,0,0,255), spacing=3, align="center")
txt.save("result"+str(cid)+".png", "PNG")
img = open('result'+str(cid)+'.png', 'rb')
Всё было нормально, но с недавнего времени начал выдавать такую ошибку:
Traceback (most recent call last):
File "bot.py", line 13658, in <module>
main_loop()
File "bot.py", line 13650, in main_loop
bot.polling(True)
File "/home/ubuntu/.local/lib/python2.7/site-packages/telebot/__init__.py", line 263, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "/home/ubuntu/.local/lib/python2.7/site-packages/telebot/__init__.py", line 287, in __threaded_polling
self.worker_pool.raise_exceptions()
File "/home/ubuntu/.local/lib/python2.7/site-packages/telebot/util.py", line 103, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "/home/ubuntu/.local/lib/python2.7/site-packages/telebot/util.py", line 54, in run
task(*args, **kwargs)
File "bot.py", line 12380, in card750Ti
d.text((20,180), namecoin, font=textfont, fill=(0,0,0,255))
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 209, in text
*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 233, in multiline_text
line_width, line_height = self.textsize(line, font)
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 260, in textsize
return font.getsize(text, direction, features)
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 156, in getsize
size, offset = self.font.getsize(text, direction, features)
SystemError: error return without exception set
Подозреваю, что это произошло после обновления сервера, но вроде ничего не изменилось ни в документации Pillow, ни у меня в коде.
В чём может быть проблема?
Created on 2005-05-05 15:38 by nbajpai, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (6) | ||
---|---|---|
msg25231 — (view) | Author: Niraj Bajpai (nbajpai) | Date: 2005-05-05 15:38 |
I am getting following error with Python 2.4.1 relase: "SystemError: error return without exception set" my code works fine with earlier release (python 2.4). Its a C code build in python so does not leave much traces to describe problem more. Important Notes: Release name: 2.4.1(final) Platform: Solaris 2.8 Error: "SystemError: error return without exception set" |
||
msg25232 — (view) | Author: Michael Hudson (mwh) | Date: 2005-05-06 11:45 |
Logged In: YES user_id=6656 Uh, there's not a lot to go on here. Can you post some code? |
||
msg25233 — (view) | Author: Niraj Bajpai (nbajpai) | Date: 2005-05-10 13:50 |
Logged In: YES user_id=1165734 Actually the same error happens in both 2.4 and 2.4.1. I call in python code to receive events from C code embedded in python interpreter. There are two meaningful events and idle event. I commented idle event in the code (C-code) and start seeing this error. from python code: x.receive(A) <<<<<<-------- Error happens here where A can be , receive "X" or receive "Y" or receive "NOTHING" In C code when I comment "NOTHING" event generator, I get the error. Some meaningful exception in python would have been better. |
||
msg25234 — (view) | Author: Michael Hudson (mwh) | Date: 2005-05-10 13:52 |
Logged In: YES user_id=6656 Are you writing your own C code? If so, why do you suspect a bug in Python itself? (Also, a debug build of python can be useful for this sort of thing). |
||
msg25235 — (view) | Author: Terry J. Reedy (terry.reedy) * | Date: 2005-05-11 23:07 |
Logged In: YES user_id=593130 When people mix their own C code with CPython and get a SystemError like this, the probability that the error is in the added code and not the core code is perhaps greater than .95. Please consider closing this report as invalid unless and until you have evidence that the problem is indeed in the core code. To get help reviewing your added code, you can post to comp.lang.python, the general Python mailing list (python.org), or gmane.comp.python.general (gmane.org). To me, the Python error message seems meaningful enough. It seems to claim that you made an error return without setting an exception according to the rules of the C API. |
||
msg25236 — (view) | Author: Niraj Bajpai (nbajpai) | Date: 2005-05-12 14:34 |
Logged In: YES user_id=1165734 Agree with the comments made. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:11 | admin | set | github: 41950 |
2005-05-05 15:38:50 | nbajpai | create |