after_merge stringlengths 28 79.6k | before_merge stringlengths 20 79.6k | url stringlengths 38 71 | full_traceback stringlengths 43 922k | traceback_type stringclasses 555
values |
|---|---|---|---|---|
def return_response(self, method, path, data, headers, response):
req_data = None
if method == "POST" and path == "/":
req_data = urlparse.parse_qs(to_str(data))
action = req_data.get("Action")[0]
if req_data:
if action == "DescribeStackResources":
if response.status_cod... | def return_response(self, method, path, data, headers, response):
req_data = None
if method == "POST" and path == "/":
req_data = urlparse.parse_qs(to_str(data))
action = req_data.get("Action")[0]
if req_data:
if action == "DescribeStackResources":
if response.status_cod... | https://github.com/localstack/localstack/issues/395 | 2017-10-11T05:49:47:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:47] "GET / HTTP/1.1" 200 -
2017-10-11T05:49:47:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:47] "GET //192.168.99.103:8080/swagger.json HTTP/1.1" 200 -
2017-10-11T05:49:48:INFO:werkzeug: 192.168.99.1 - - [11/Oct/2017 05:49:48] "GET /img/locals... | KeyError |
def forward_request(self, method, path, data, headers):
modified_data = None
# If this request contains streaming v4 authentication signatures, strip them from the message
# Related isse: https://github.com/localstack/localstack/issues/98
# TODO we should evaluate whether to replace moto s3 with scalit... | def forward_request(self, method, path, data, headers):
modified_data = None
# If this request contains streaming v4 authentication signatures, strip them from the message
# Related isse: https://github.com/localstack/localstack/issues/98
# TODO we should evaluate whether to replace moto s3 with scalit... | https://github.com/localstack/localstack/issues/396 | 2017-10-10T10:58:34:ERROR:localstack.services.generic_proxy: Error forwarding request: string indices must be integers Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/localstack/services/generic_proxy.py", line 194, in forward
path=path, data=data, headers=forward_headers, response=respo... | TypeError |
def filter_rules_match(filters, object_path):
"""check whether the given object path matches all of the given filters"""
filters = filters or {}
s3_filter = _get_s3_filter(filters)
for rule in s3_filter.get("FilterRule", []):
if rule["Name"] == "prefix":
if not prefix_with_slash(obje... | def filter_rules_match(filters, object_path):
"""check whether the given object path matches all of the given filters"""
filters = filters or {}
key_filter = filters.get("S3Key", filters.get("Key", {}))
for rule in key_filter.get("FilterRule", []):
if rule["Name"] == "prefix":
if not... | https://github.com/localstack/localstack/issues/396 | 2017-10-10T10:58:34:ERROR:localstack.services.generic_proxy: Error forwarding request: string indices must be integers Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/localstack/services/generic_proxy.py", line 194, in forward
path=path, data=data, headers=forward_headers, response=respo... | TypeError |
def expand_multipart_filename(data, headers):
"""Replace instance of '${filename}' in key with given file name.
Data is given as multipart form submission bytes, and file name is
replace according to Amazon S3 documentation for Post uploads:
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST... | def expand_multipart_filename(data, headers):
"""Replace instance of '${filename}' in key with given file name.
Data is given as multipart form submission bytes, and file name is
replace according to Amazon S3 documentation for Post uploads:
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST... | https://github.com/localstack/localstack/issues/396 | 2017-10-10T10:58:34:ERROR:localstack.services.generic_proxy: Error forwarding request: string indices must be integers Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/localstack/services/generic_proxy.py", line 194, in forward
path=path, data=data, headers=forward_headers, response=respo... | TypeError |
def find_multipart_redirect_url(data, headers):
"""Return object key and redirect URL if they can be found.
Data is given as multipart form submission bytes, and redirect is found
in the success_action_redirect field according to Amazon S3
documentation for Post uploads:
http://docs.aws.amazon.com/... | def find_multipart_redirect_url(data, headers):
"""Return object key and redirect URL if they can be found.
Data is given as multipart form submission bytes, and redirect is found
in the success_action_redirect field according to Amazon S3
documentation for Post uploads:
http://docs.aws.amazon.com/... | https://github.com/localstack/localstack/issues/396 | 2017-10-10T10:58:34:ERROR:localstack.services.generic_proxy: Error forwarding request: string indices must be integers Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/localstack/services/generic_proxy.py", line 194, in forward
path=path, data=data, headers=forward_headers, response=respo... | TypeError |
def forward_request(self, method, path, data, headers):
modified_data = None
# If this request contains streaming v4 authentication signatures, strip them from the message
# Related isse: https://github.com/localstack/localstack/issues/98
# TODO we should evaluate whether to replace moto s3 with scalit... | def forward_request(self, method, path, data, headers):
modified_data = None
# If this request contains streaming v4 authentication signatures, strip them from the message
# Related isse: https://github.com/localstack/localstack/issues/98
# TODO we should evaluate whether to replace moto s3 with scalit... | https://github.com/localstack/localstack/issues/396 | 2017-10-10T10:58:34:ERROR:localstack.services.generic_proxy: Error forwarding request: string indices must be integers Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/localstack/services/generic_proxy.py", line 194, in forward
path=path, data=data, headers=forward_headers, response=respo... | TypeError |
def expand_multipart_filename(data, headers):
"""Replace instance of '${filename}' in key with given file name.
Data is given as multipart form submission bytes, and file name is
replace according to Amazon S3 documentation for Post uploads:
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST... | def expand_multipart_filename(data, headers):
"""Replace instance of '${filename}' in key with given file name.
Data is given as multipart form submission bytes, and file name is
replace according to Amazon S3 documentation for Post uploads:
http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST... | https://github.com/localstack/localstack/issues/310 | 2017-09-11T04:24:30:ERROR:localstack.services.generic_proxy: Error forwarding request: 'boundary' Traceback (most recent call last):
File "/opt/code/localstack/localstack/services/generic_proxy.py", line 166, in forward
path=path, data=data, headers=forward_headers)
File "/opt/code/localstack/localstack/services/s3/s3_... | KeyError |
def post_request():
action = request.headers.get("x-amz-target")
data = json.loads(to_str(request.data))
result = {}
kinesis = aws_stack.connect_to_service("kinesis")
if action == "%s.ListStreams" % ACTION_HEADER_PREFIX:
result = {
"Streams": list(DDB_STREAMS.values()),
... | def post_request():
action = request.headers.get("x-amz-target")
data = json.loads(to_str(request.data))
result = None
kinesis = aws_stack.connect_to_service("kinesis")
if action == "%s.ListStreams" % ACTION_HEADER_PREFIX:
result = {
"Streams": list(DDB_STREAMS.values()),
... | https://github.com/localstack/localstack/issues/219 | $ localstack start
Starting local dev environment. CTRL-C to quit.
Error starting infrastructure: 'zipimport.zipimporter' object has no attribute 'path'
Traceback (most recent call last):
File ".../bin/localstack", line 86, in <module>
infra.start_infra()
File ".../lib/python3.6/site-packages/localstack/services/infra.... | AttributeError |
def forward(self, method):
path = self.path
if "://" in path:
path = "/" + path.split("://", 1)[1].split("/", 1)[1]
proxy_url = "http://%s%s" % (self.proxy.forward_host, path)
target_url = self.path
if "://" not in target_url:
target_url = "http://%s%s" % (self.proxy.forward_host, ta... | def forward(self, method):
path = self.path
if "://" in path:
path = "/" + path.split("://", 1)[1].split("/", 1)[1]
proxy_url = "http://%s%s" % (self.proxy.forward_host, path)
target_url = self.path
if "://" not in target_url:
target_url = "http://%s%s" % (self.proxy.forward_host, ta... | https://github.com/localstack/localstack/issues/83 | ERROR:localstack.mock.generic_proxy:Error forwarding request: Traceback (most recent call last):
File "/opt/code/localstack/localstack/mock/generic_proxy.py", line 88, in forward
data=data, headers=self.headers, return_forward_info=True)
File "/opt/code/localstack/localstack/mock/proxy/sns_listener.py", line 37, in upd... | ResponseParserError |
def update_cloudformation(
method, path, data, headers, response=None, return_forward_info=False
):
req_data = None
if method == "POST" and path == "/":
req_data = urlparse.parse_qs(data)
action = req_data.get("Action")[0]
if return_forward_info:
if req_data:
if acti... | def update_cloudformation(
method, path, data, headers, response=None, return_forward_info=False
):
req_data = None
if method == "POST" and path == "/":
req_data = urlparse.parse_qs(data)
action = req_data.get("Action")[0]
if return_forward_info:
if req_data:
if acti... | https://github.com/localstack/localstack/issues/83 | ERROR:localstack.mock.generic_proxy:Error forwarding request: Traceback (most recent call last):
File "/opt/code/localstack/localstack/mock/generic_proxy.py", line 88, in forward
data=data, headers=self.headers, return_forward_info=True)
File "/opt/code/localstack/localstack/mock/proxy/sns_listener.py", line 37, in upd... | ResponseParserError |
def update_dynamodb(
method, path, data, headers, response=None, return_forward_info=False
):
if return_forward_info:
if random.random() < config.DYNAMODB_ERROR_PROBABILITY:
return dynamodb_error_response(data)
return True
# update table definitions
if data and "TableName" i... | def update_dynamodb(
method, path, data, headers, response=None, return_forward_info=False
):
if return_forward_info:
if random.random() < config.DYNAMODB_ERROR_PROBABILITY:
return dynamodb_error_response(data)
return True
# update table definitions
if data and "TableName" i... | https://github.com/localstack/localstack/issues/83 | ERROR:localstack.mock.generic_proxy:Error forwarding request: Traceback (most recent call last):
File "/opt/code/localstack/localstack/mock/generic_proxy.py", line 88, in forward
data=data, headers=self.headers, return_forward_info=True)
File "/opt/code/localstack/localstack/mock/proxy/sns_listener.py", line 37, in upd... | ResponseParserError |
def update_s3(method, path, data, headers, response=None, return_forward_info=False):
if return_forward_info:
modified_data = None
# If this request contains streaming v4 authentication signatures, strip them from the message
# Related isse: https://github.com/atlassian/localstack/issues/98... | def update_s3(method, path, data, headers, response=None, return_forward_info=False):
if return_forward_info:
modified_data = None
# If this request contains streaming v4 authentication signatures, strip them from the message
# Related isse: https://github.com/atlassian/localstack/issues/98... | https://github.com/localstack/localstack/issues/83 | ERROR:localstack.mock.generic_proxy:Error forwarding request: Traceback (most recent call last):
File "/opt/code/localstack/localstack/mock/generic_proxy.py", line 88, in forward
data=data, headers=self.headers, return_forward_info=True)
File "/opt/code/localstack/localstack/mock/proxy/sns_listener.py", line 37, in upd... | ResponseParserError |
def get_client(resource):
resource_type = get_resource_type(resource)
service = get_service_name(resource)
resource_config = RESOURCE_TO_FUNCTION.get(resource_type)
if resource_config is None:
raise Exception(
"CloudFormation deployment for resource type %s not yet implemented"
... | def get_client(resource):
resource_type = get_resource_type(resource)
service = get_service_name(resource)
if (
RESOURCE_TO_FUNCTION[resource_type][ACTION_CREATE].get("boto_client")
== "resource"
):
return aws_stack.connect_to_resource(service)
return aws_stack.connect_to_ser... | https://github.com/localstack/localstack/issues/83 | ERROR:localstack.mock.generic_proxy:Error forwarding request: Traceback (most recent call last):
File "/opt/code/localstack/localstack/mock/generic_proxy.py", line 88, in forward
data=data, headers=self.headers, return_forward_info=True)
File "/opt/code/localstack/localstack/mock/proxy/sns_listener.py", line 37, in upd... | ResponseParserError |
def deploy_resource(resource_id, resources, stack_name):
resource = resources[resource_id]
client = get_client(resource)
if not client:
return False
resource_type = get_resource_type(resource)
func_details = RESOURCE_TO_FUNCTION.get(resource_type)
if not func_details:
LOGGER.warn... | def deploy_resource(resource):
client = get_client(resource)
resource_type = get_resource_type(resource)
func_details = RESOURCE_TO_FUNCTION.get(resource_type)
if not func_details:
LOGGER.warning("Resource type not yet implemented: %s" % resource["Type"])
return
func_details = func_d... | https://github.com/localstack/localstack/issues/83 | ERROR:localstack.mock.generic_proxy:Error forwarding request: Traceback (most recent call last):
File "/opt/code/localstack/localstack/mock/generic_proxy.py", line 88, in forward
data=data, headers=self.headers, return_forward_info=True)
File "/opt/code/localstack/localstack/mock/proxy/sns_listener.py", line 37, in upd... | ResponseParserError |
def deploy_template(template, stack_name):
if isinstance(template, string_types):
template = parse_template(template)
if MARKER_DONT_REDEPLOY_STACK in template:
# If we are currently deploying, then bail. This can occur if
# deploy_template(..) method calls boto's update_stack(..) (to u... | def deploy_template(template):
if isinstance(template, string_types):
template = parse_template(template)
for key, resource in iteritems(template["Resources"]):
deploy_resource(resource)
| https://github.com/localstack/localstack/issues/83 | ERROR:localstack.mock.generic_proxy:Error forwarding request: Traceback (most recent call last):
File "/opt/code/localstack/localstack/mock/generic_proxy.py", line 88, in forward
data=data, headers=self.headers, return_forward_info=True)
File "/opt/code/localstack/localstack/mock/proxy/sns_listener.py", line 37, in upd... | ResponseParserError |
def send_command():
"""
Run a remote command. This is called via py3-cmd utility.
We look for any uds sockets with the correct name prefix and send our
command to all that we find. This allows us to communicate with multiple
py3status instances.
"""
def verbose(msg):
"""
p... | def send_command():
"""
Run a remote command. This is called via py3-cmd utility.
We look for any uds sockets with the correct name prefix and send our
command to all that we find. This allows us to communicate with multiple
py3status instances.
"""
def verbose(msg):
"""
p... | https://github.com/ultrabug/py3status/issues/2003 | $ uname -a
Linux eolas 5.10.12-arch1-1 #1 SMP PREEMPT Sun, 31 Jan 2021 00:41:06 +0000 x86_64 GNU/Linux
$ py3-cmd --version
py3status 3.32 (python 3.9.1)
$ py3-cmd refresh --all
Traceback (most recent call last):
File "/usr/bin/py3-cmd", line 13, in <module>
sys.exit(send_command())
File "/usr/lib/python3.9/site-package... | NotImplementedError |
def _add_player(self, player_id):
"""
Add player to mpris_players
"""
if not player_id.startswith(SERVICE_BUS):
return False
player = self._dbus.get(player_id, SERVICE_BUS_URL)
if player.Identity not in self._mpris_names:
self._mpris_names[player.Identity] = player_id.split("."... | def _add_player(self, player_id):
"""
Add player to mpris_players
"""
if not player_id.startswith(SERVICE_BUS):
return False
player = self._dbus.get(player_id, SERVICE_BUS_URL)
if player.Identity not in self._mpris_names:
self._mpris_names[player.Identity] = player_id.split("."... | https://github.com/ultrabug/py3status/issues/911 | lasers~/src/py3status/py3status/modules git:(master) python3 mpris.py.
Traceback (most recent call last):
File "mpris.py", line 578, in <module>
module_test(Py3status)
File "/usr/lib/python3.6/site-packages/py3status-3.6rc1-py3.6.egg/py3status/module_test.py", line 47, in module_test
module.post_config_hook()
File "mpr... | AttributeError |
def backlight(self):
full_text = ""
if self.device_path is not None:
level = self._get_backlight_level()
full_text = self.py3.safe_format(self.format, {"level": level})
response = {
"cached_until": self.py3.time_in(self.cache_timeout),
"full_text": full_text,
}
retur... | def backlight(self):
level = self._get_backlight_level()
full_text = self.py3.safe_format(self.format, {"level": level})
response = {
"cached_until": self.py3.time_in(self.cache_timeout),
"full_text": full_text,
}
return response
| https://github.com/ultrabug/py3status/issues/557 | Traceback (most recent call last):
File "battery_level.py", line 448, in <module>
module_test(Py3status)
File "/usr/lib/python3.5/site-packages/py3status/module_test.py", line 51, in module_test
print(getattr(module, method)(*method_args))
File "battery_level.py", line 174, in battery_level
self._refresh_battery_info()... | IndexError |
def battery_level(self):
if not os.listdir(self.sys_battery_path):
return {"full_text": "", "cached_until": self.py3.time_in(self.cache_timeout)}
self._refresh_battery_info()
self._update_icon()
self._update_ascii_bar()
self._update_full_text()
return self._build_response()
| def battery_level(self):
self._refresh_battery_info()
self._update_icon()
self._update_ascii_bar()
self._update_full_text()
return self._build_response()
| https://github.com/ultrabug/py3status/issues/557 | Traceback (most recent call last):
File "battery_level.py", line 448, in <module>
module_test(Py3status)
File "/usr/lib/python3.5/site-packages/py3status/module_test.py", line 51, in module_test
print(getattr(module, method)(*method_args))
File "battery_level.py", line 174, in battery_level
self._refresh_battery_info()... | IndexError |
def _config_from_pyproject(path):
if os.path.isfile(path):
try:
with open(path, "r") as f:
pyproject = tomlkit.loads(f.read())
if pyproject:
return pyproject.get("tool", {}).get("semantic_release", {})
except TOMLKitError as e:
logg... | def _config_from_pyproject(path):
if os.path.isfile(path):
try:
with open(path, "r") as f:
pyproject = tomlkit.loads(f.read())
if pyproject:
return dict(pyproject.get("tool").get("semantic_release"))
except TOMLKitError as e:
logger... | https://github.com/relekang/python-semantic-release/issues/317 | Run relekang/python-semantic-release@master
/usr/bin/docker run --name eb9cc679ae0e4f1f83d7f2d23985a34f_6e2f70 --label 442333 --workdir /github/workspace --rm -e INPUT_GITHUB_TOKEN -e INPUT_PYPI_TOKEN -e INPUT_DIRECTORY -e INPUT_PYPI_USERNAME -e INPUT_PYPI_PASSWORD -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e G... | TypeError |
def commit_new_version(version: str):
"""
Commits the file containing the version number variable with the version number as the commit
message.
:param version: The version number to be used in the commit message.
"""
check_repo()
commit_message = config.get("semantic_release", "commit_mes... | def commit_new_version(version: str):
"""
Commits the file containing the version number variable with the version number as the commit
message.
:param version: The version number to be used in the commit message.
"""
check_repo()
commit_message = config.get("semantic_release", "commit_mes... | https://github.com/relekang/python-semantic-release/issues/66 | venv) C:\workspace\checklive\src>semantic-release --patch publish
Traceback (most recent call last):
File "c:\python35\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "c:\python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\workspace\checklive\venv\Scripts\semantic-r... | git.exc.NoSuchPathError |
def __getattr__(self, key):
# TODO keep this for a version, in order to not break old code
# this entire method (as well as the _dict attribute in __slots__ and the __setattr__ method)
# can be removed in 4.0
# this method is only called if the attribute was not found elsewhere, like in __slots_
if ... | def __getattr__(self, key):
# TODO keep this for a version, in order to not break old code
# this entire method (as well as the _dict attribute in __slots__ and the __setattr__ method)
# can be removed in 4.0
# this method is only called if the attribute was not found elsewhere, like in __slots__
tr... | https://github.com/hardbyte/python-can/issues/804 | /usr/bin/python3.7 /XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SerializationTest.py
2020-04-02 13:35:59,352:MainThread:INFO: Created a socket
2020-04-02 13:35:59,389:MainThread:INFO: pickled
Traceback (most recent call last):
File "/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SerializationTest.py", line 39, in <module>
canReader.run()
File "... | RecursionError |
def build_bcm_header(
opcode,
flags,
count,
ival1_seconds,
ival1_usec,
ival2_seconds,
ival2_usec,
can_id,
nframes,
):
result = BcmMsgHead(
opcode=opcode,
flags=flags,
count=count,
ival1_tv_sec=ival1_seconds,
ival1_tv_usec=ival1_usec,
... | def build_bcm_header(
opcode,
flags,
count,
ival1_seconds,
ival1_usec,
ival2_seconds,
ival2_usec,
can_id,
nframes,
):
# == Must use native not standard types for packing ==
# struct bcm_msg_head {
# __u32 opcode; -> I
# __u32 flags; -> I
# __u32 count... | https://github.com/hardbyte/python-can/issues/470 | Traceback (most recent call last):
File "./test.py", line 8, in <module>
bus.send_periodic(msg, 0.01, 9)
File "/usr/local/lib/python3.5/dist-packages/can/bus.py", line 201, in send_periodic
task = self._send_periodic_internal(msg, period, duration)
File "/usr/local/lib/python3.5/dist-packages/can/interfaces/socketcan/... | can.CanError |
def __init__(self, channel, ttyBaudrate=115200, timeout=1, bitrate=None, **kwargs):
"""
:param str channel:
port of underlying serial or usb device (e.g. /dev/ttyUSB0, COM8, ...)
Must not be empty.
:param int ttyBaudrate:
baudrate of underlying serial or usb device
:param int bit... | def __init__(self, channel, ttyBaudrate=115200, timeout=1, bitrate=None, **kwargs):
"""
:param str channel:
port of underlying serial or usb device (e.g. /dev/ttyUSB0, COM8, ...)
Must not be empty.
:param int ttyBaudrate:
baudrate of underlying serial or usb device
:param int bit... | https://github.com/hardbyte/python-can/issues/382 | DEBUG:can:loaded can config: {'interface': 'slcan', 'channel': '/dev/ttyUSB0@115200'}
Traceback (most recent call last):
File "encoder-test.py", line 19, in <module>
network.connect(channel='/dev/ttyUSB0@115200', bustype='slcan')
File "/usr/local/lib/python3.5/dist-packages/canopen/network.py", line 100, in connect
sel... | AttributeError |
def write(self, string):
if not string.endswith("\r"):
string += "\r"
self.serialPortOrig.write(string.encode())
self.serialPortOrig.flush()
| def write(self, string):
if not string.endswith("\r"):
string += "\r"
self.serialPort.write(string.decode())
self.serialPort.flush()
| https://github.com/hardbyte/python-can/issues/382 | DEBUG:can:loaded can config: {'interface': 'slcan', 'channel': '/dev/ttyUSB0@115200'}
Traceback (most recent call last):
File "encoder-test.py", line 19, in <module>
network.connect(channel='/dev/ttyUSB0@115200', bustype='slcan')
File "/usr/local/lib/python3.5/dist-packages/canopen/network.py", line 100, in connect
sel... | AttributeError |
def _recv_internal(self, timeout):
if timeout is not None:
self.serialPortOrig.timeout = timeout
canId = None
remote = False
extended = False
frame = []
readStr = self.serialPortOrig.read_until(b"\r")
if not readStr:
return None, False
else:
readStr = readStr.d... | def _recv_internal(self, timeout):
if timeout is not None:
self.serialPortOrig.timeout = timeout
canId = None
remote = False
extended = False
frame = []
readStr = self.serialPort.readline()
if not readStr:
return None, False
else:
if readStr[0] == "T":
... | https://github.com/hardbyte/python-can/issues/382 | DEBUG:can:loaded can config: {'interface': 'slcan', 'channel': '/dev/ttyUSB0@115200'}
Traceback (most recent call last):
File "encoder-test.py", line 19, in <module>
network.connect(channel='/dev/ttyUSB0@115200', bustype='slcan')
File "/usr/local/lib/python3.5/dist-packages/canopen/network.py", line 100, in connect
sel... | AttributeError |
def __init__(self, filename):
self.fp = open(filename, "rb")
data = self.fp.read(FILE_HEADER_STRUCT.size)
header = FILE_HEADER_STRUCT.unpack(data)
# print(header)
if header[0] != b"LOGG":
raise BLFParseError("Unexpected file format")
self.file_size = header[10]
self.uncompressed_size... | def __init__(self, filename):
self.fp = open(filename, "rb")
data = self.fp.read(FILE_HEADER_STRUCT.size)
header = FILE_HEADER_STRUCT.unpack(data)
# print(header)
assert header[0] == b"LOGG", "Unknown file format"
self.file_size = header[10]
self.uncompressed_size = header[11]
self.objec... | https://github.com/hardbyte/python-can/issues/314 | Traceback (most recent call last):
File "D:\eclipse-workspace\blf2csv\pythoncan_blf2csv.py", line 7, in <module>
logging = list(logging)
File "C:\Users\my_user_name\AppData\Local\Python\Python36\lib\site-packages\can\io\blf.py", line 129, in __iter__
assert header[0] == b"LOBJ", "Parse error"
AssertionError: Parse erro... | AssertionError |
def __iter__(self):
tail = b""
while True:
data = self.fp.read(OBJ_HEADER_BASE_STRUCT.size)
if not data:
# EOF
break
header = OBJ_HEADER_BASE_STRUCT.unpack(data)
# print(header)
if header[0] != b"LOBJ":
raise BLFParseError()
ob... | def __iter__(self):
tail = b""
while True:
data = self.fp.read(OBJ_HEADER_BASE_STRUCT.size)
if not data:
# EOF
break
header = OBJ_HEADER_BASE_STRUCT.unpack(data)
# print(header)
assert header[0] == b"LOBJ", "Parse error"
obj_type = header[... | https://github.com/hardbyte/python-can/issues/314 | Traceback (most recent call last):
File "D:\eclipse-workspace\blf2csv\pythoncan_blf2csv.py", line 7, in <module>
logging = list(logging)
File "C:\Users\my_user_name\AppData\Local\Python\Python36\lib\site-packages\can\io\blf.py", line 129, in __iter__
assert header[0] == b"LOBJ", "Parse error"
AssertionError: Parse erro... | AssertionError |
def __init__(self, filename, channel=1):
self.fp = open(filename, "wb")
self.channel = channel
# Header will be written after log is done
self.fp.write(b"\x00" * FILE_HEADER_SIZE)
self.cache = []
self.cache_size = 0
self.count_of_objects = 0
self.uncompressed_size = FILE_HEADER_SIZE
... | def __init__(self, filename, channel=1):
self.fp = open(filename, "wb")
self.channel = channel
# Header will be written after log is done
self.fp.write(b"\x00" * FILE_HEADER_STRUCT.size)
self.cache = []
self.cache_size = 0
self.count_of_objects = 0
self.uncompressed_size = FILE_HEADER_ST... | https://github.com/hardbyte/python-can/issues/314 | Traceback (most recent call last):
File "D:\eclipse-workspace\blf2csv\pythoncan_blf2csv.py", line 7, in <module>
logging = list(logging)
File "C:\Users\my_user_name\AppData\Local\Python\Python36\lib\site-packages\can\io\blf.py", line 129, in __iter__
assert header[0] == b"LOBJ", "Parse error"
AssertionError: Parse erro... | AssertionError |
def _add_object(self, obj_type, data, timestamp=None):
if timestamp is None:
timestamp = self.stop_timestamp or time.time()
if self.start_timestamp is None:
self.start_timestamp = timestamp
self.stop_timestamp = timestamp
timestamp = int((timestamp - self.start_timestamp) * 1e9)
head... | def _add_object(self, obj_type, data, timestamp=None):
if timestamp is None:
timestamp = self.stop_timestamp or time.time()
if self.start_timestamp is None:
self.start_timestamp = timestamp
self.stop_timestamp = timestamp
timestamp = int((timestamp - self.start_timestamp) * 1e9)
obj_... | https://github.com/hardbyte/python-can/issues/314 | Traceback (most recent call last):
File "D:\eclipse-workspace\blf2csv\pythoncan_blf2csv.py", line 7, in <module>
logging = list(logging)
File "C:\Users\my_user_name\AppData\Local\Python\Python36\lib\site-packages\can\io\blf.py", line 129, in __iter__
assert header[0] == b"LOBJ", "Parse error"
AssertionError: Parse erro... | AssertionError |
def _flush(self):
"""Compresses and writes data in the cache to file."""
if self.fp.closed:
return
cache = b"".join(self.cache)
if not cache:
# Nothing to write
return
uncompressed_data = cache[: self.MAX_CACHE_SIZE]
# Save data that comes after max size to next round
... | def _flush(self):
"""Compresses and writes data in the cache to file."""
if self.fp.closed:
return
cache = b"".join(self.cache)
if not cache:
# Nothing to write
return
uncompressed_data = cache[: self.MAX_CACHE_SIZE]
# Save data that comes after max size to next round
... | https://github.com/hardbyte/python-can/issues/314 | Traceback (most recent call last):
File "D:\eclipse-workspace\blf2csv\pythoncan_blf2csv.py", line 7, in <module>
logging = list(logging)
File "C:\Users\my_user_name\AppData\Local\Python\Python36\lib\site-packages\can\io\blf.py", line 129, in __iter__
assert header[0] == b"LOBJ", "Parse error"
AssertionError: Parse erro... | AssertionError |
def stop(self):
"""Stops logging and closes the file."""
if self.fp.closed:
return
self._flush()
filesize = self.fp.tell()
self.fp.close()
# Write header in the beginning of the file
header = [b"LOGG", FILE_HEADER_SIZE, APPLICATION_ID, 0, 0, 0, 2, 6, 8, 1]
# The meaning of "coun... | def stop(self):
"""Stops logging and closes the file."""
if self.fp.closed:
return
self._flush()
filesize = self.fp.tell()
self.fp.close()
# Write header in the beginning of the file
header = [b"LOGG", FILE_HEADER_STRUCT.size, APPLICATION_ID, 0, 0, 0, 2, 6, 8, 1]
# The meaning o... | https://github.com/hardbyte/python-can/issues/314 | Traceback (most recent call last):
File "D:\eclipse-workspace\blf2csv\pythoncan_blf2csv.py", line 7, in <module>
logging = list(logging)
File "C:\Users\my_user_name\AppData\Local\Python\Python36\lib\site-packages\can\io\blf.py", line 129, in __iter__
assert header[0] == b"LOBJ", "Parse error"
AssertionError: Parse erro... | AssertionError |
def set_filters(self, can_filters=None):
"""Apply filtering to all messages received by this Bus.
Calling without passing any filters will reset the applied filters.
Since Kvaser only supports setting one filter per handle, the filtering
will be disabled if more than one filter is requested.
:par... | def set_filters(self, can_filters=None):
"""Apply filtering to all messages received by this Bus.
Calling without passing any filters will reset the applied filters.
Since Kvaser only supports setting one filter per handle, the filtering
will be done in the :meth:`recv` if more than one filter is requ... | https://github.com/hardbyte/python-can/issues/154 | Traceback (most recent call last):
File "pycan-test.py", line 3, in <module>
interface = KvaserBus(0)
File "/usr/local/lib/python2.7/dist-packages/can/interfaces/kvaser/canlib.py", line 361, in __init__
self.set_filters(can_filters)
File "/usr/local/lib/python2.7/dist-packages/can/interfaces/kvaser/canlib.py", line 413... | NotImplementedError |
def set_filters(self, can_filters=None):
"""Apply filtering to all messages received by this Bus.
Calling without passing any filters will reset the applied filters.
Since Kvaser only supports setting one filter per handle, the filtering
will be disabled if more than one filter is requested.
:par... | def set_filters(self, can_filters=None):
"""Apply filtering to all messages received by this Bus.
Calling without passing any filters will reset the applied filters.
Since Kvaser only supports setting one filter per handle, the filtering
will be disabled if more than one filter is requested.
:par... | https://github.com/hardbyte/python-can/issues/154 | Traceback (most recent call last):
File "pycan-test.py", line 3, in <module>
interface = KvaserBus(0)
File "/usr/local/lib/python2.7/dist-packages/can/interfaces/kvaser/canlib.py", line 361, in __init__
self.set_filters(can_filters)
File "/usr/local/lib/python2.7/dist-packages/can/interfaces/kvaser/canlib.py", line 413... | NotImplementedError |
def db_writer_thread(self):
num_frames = 0
last_write = time.time()
self._create_db()
while not self.stop_running_event.is_set():
messages = []
m = self.get_message(self.GET_MESSAGE_TIMEOUT)
while m is not None:
log.debug("sqlitewriter buffering message")
... | def db_writer_thread(self):
num_frames = 0
last_write = time.time()
self._create_db()
while not self.stop_running_event.is_set():
messages = []
m = self.get_message(self.GET_MESSAGE_TIMEOUT)
while m is not None:
log.debug("sqlitewriter buffering message")
... | https://github.com/hardbyte/python-can/issues/139 | ======================================================================
FAIL: test_sql_reader (listener_test.FileReaderTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/hardbyte/python-can/test/listener_test.py", line 179, in test_sql... | AssertionError |
def __init__(self, filename):
self.csv_file = open(filename, "wt")
# Write a header row
self.csv_file.write(
"timestamp, arbitration id, extended, remote, error, dlc, data\n"
)
| def __init__(self, filename):
self.csv_file = open(filename, "wt")
# Write a header row
self.csv_file.write("timestamp, arbitrationid, flags, dlc, data")
| https://github.com/hardbyte/python-can/issues/72 | #!shell
(py35_python_can) e:\bitbucket_hg\python-can\bin>python can_logger.py -f ./temp.txt
Can Logger (Started on 2016-07-19 09:49:10.052735)
enter..
Shutdown Bus and Exit.
exit..
close exit ..
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python35\lib\threading.py", line 914, in _bootst... | ValueError |
def on_message_received(self, msg):
row = ",".join(
[
str(msg.timestamp),
hex(msg.arbitration_id),
"1" if msg.id_type else "0",
"1" if msg.is_remote_frame else "0",
"1" if msg.is_error_frame else "0",
str(msg.dlc),
base64.b6... | def on_message_received(self, msg):
row = ",".join([msg.timestamp, msg.arbitration_id, msg.flags, msg.dlc, msg.data])
self.csv_file.write(row + "\n")
| https://github.com/hardbyte/python-can/issues/72 | #!shell
(py35_python_can) e:\bitbucket_hg\python-can\bin>python can_logger.py -f ./temp.txt
Can Logger (Started on 2016-07-19 09:49:10.052735)
enter..
Shutdown Bus and Exit.
exit..
close exit ..
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python35\lib\threading.py", line 914, in _bootst... | ValueError |
def __init__(self, bus, listeners, timeout=None):
"""Manages the distribution of **Messages** from a given bus to a
list of listeners.
:param bus: The :ref:`bus` to listen too.
:param listeners: An iterable of :class:`~can.Listeners`
:param timeout: An optional maximum number of seconds to wait for... | def __init__(self, bus, listeners, timeout=None):
"""Manages the distribution of **Messages** from a given bus to a
list of listeners.
:param bus: The :class:`~can.Bus` to listen too.
:param listeners: An iterable of :class:`~can.Listeners`
:param timeout: An optional maximum number of seconds to w... | https://github.com/hardbyte/python-can/issues/72 | #!shell
(py35_python_can) e:\bitbucket_hg\python-can\bin>python can_logger.py -f ./temp.txt
Can Logger (Started on 2016-07-19 09:49:10.052735)
enter..
Shutdown Bus and Exit.
exit..
close exit ..
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python35\lib\threading.py", line 914, in _bootst... | ValueError |
def stop(self):
"""Stop notifying Listeners when new :class:`~can.Message` objects arrive
and call :meth:`~can.Listener.stop` on each Listener."""
self.running.clear()
if self.timeout is not None:
self._reader.join(self.timeout + 0.1)
| def stop(self):
self.running.clear()
if self.timeout is not None:
self._reader.join(self.timeout + 0.1)
| https://github.com/hardbyte/python-can/issues/72 | #!shell
(py35_python_can) e:\bitbucket_hg\python-can\bin>python can_logger.py -f ./temp.txt
Can Logger (Started on 2016-07-19 09:49:10.052735)
enter..
Shutdown Bus and Exit.
exit..
close exit ..
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python35\lib\threading.py", line 914, in _bootst... | ValueError |
def rx_thread(self):
while self.running.is_set():
msg = self.bus.recv(self.timeout)
if msg is not None:
for callback in self.listeners:
callback(msg)
for listener in self.listeners:
listener.stop()
| def rx_thread(self):
while self.running.is_set():
msg = self.bus.recv(self.timeout)
if msg is not None:
for callback in self.listeners:
callback(msg)
| https://github.com/hardbyte/python-can/issues/72 | #!shell
(py35_python_can) e:\bitbucket_hg\python-can\bin>python can_logger.py -f ./temp.txt
Can Logger (Started on 2016-07-19 09:49:10.052735)
enter..
Shutdown Bus and Exit.
exit..
close exit ..
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python35\lib\threading.py", line 914, in _bootst... | ValueError |
async def get(self):
user = self.current_user
if user is None:
# whoami can be accessed via oauth token
user = self.get_current_user_oauth_token()
if user is None:
raise web.HTTPError(403)
if isinstance(user, orm.Service):
model = self.service_model(user)
else:
... | async def get(self):
user = self.current_user
if user is None:
# whoami can be accessed via oauth token
user = self.get_current_user_oauth_token()
if user is None:
raise web.HTTPError(403)
self.write(json.dumps(self.user_model(user)))
| https://github.com/jupyterhub/jupyterhub/issues/3217 | Uncaught exception GET /hub/api/user (172.17.0.2)
HTTPServerRequest(protocol='http', host='172.17.0.2:8081', method='GET', uri='/hub/api/user', version='HTTP/1.1', remote_ip='172.17.0.2')
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1703, in _execute
result = awa... | AttributeError |
async def shutdown_cancel_tasks(self, sig):
"""Cancel all other tasks of the event loop and initiate cleanup"""
self.log.critical("Received signal %s, initiating shutdown...", sig.name)
tasks = [t for t in asyncio_all_tasks() if t is not asyncio_current_task()]
if tasks:
self.log.debug("Cancell... | async def shutdown_cancel_tasks(self, sig):
"""Cancel all other tasks of the event loop and initiate cleanup"""
self.log.critical("Received signal %s, initiating shutdown...", sig.name)
tasks = [
t for t in asyncio.Task.all_tasks() if t is not asyncio.Task.current_task()
]
if tasks:
... | https://github.com/jupyterhub/jupyterhub/issues/3297 | ^C[C 2020-12-02 16:16:45.801 JupyterHub app:2810] Received signal SIGINT, initiating shutdown...
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-8' coro=<JupyterHub.shutdown_cancel_tasks() done, defined at /opt/miniconda3/envs/jupyterhub/lib/python3.9/site-packages/jupyterhub/app.py:2... | AttributeError |
def print_stacks(file=sys.stderr):
"""Print current status of the process
For debugging purposes.
Used as part of SIGINFO handler.
- Shows active thread count
- Shows current stack for all threads
Parameters:
file: file to write output to (default: stderr)
"""
# local imports be... | def print_stacks(file=sys.stderr):
"""Print current status of the process
For debugging purposes.
Used as part of SIGINFO handler.
- Shows active thread count
- Shows current stack for all threads
Parameters:
file: file to write output to (default: stderr)
"""
# local imports be... | https://github.com/jupyterhub/jupyterhub/issues/3297 | ^C[C 2020-12-02 16:16:45.801 JupyterHub app:2810] Received signal SIGINT, initiating shutdown...
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-8' coro=<JupyterHub.shutdown_cancel_tasks() done, defined at /opt/miniconda3/envs/jupyterhub/lib/python3.9/site-packages/jupyterhub/app.py:2... | AttributeError |
async def api_request(self, path, method="GET", body=None, client=None):
"""Make an authenticated API request of the proxy."""
client = client or AsyncHTTPClient()
url = url_path_join(self.api_url, "api/routes", path)
if isinstance(body, dict):
body = json.dumps(body)
self.log.debug("Proxy:... | async def api_request(self, path, method="GET", body=None, client=None):
"""Make an authenticated API request of the proxy."""
client = client or AsyncHTTPClient()
url = url_path_join(self.api_url, "api/routes", path)
if isinstance(body, dict):
body = json.dumps(body)
self.log.debug("Proxy:... | https://github.com/jupyterhub/jupyterhub/issues/3222 | [I 2020-10-20 16:48:25.540 JupyterHub base:893] User testuser-aa6aa5ea-64bb-4719-93c7-04557f25c3d5 took 2.179 seconds to start
[I 2020-10-20 16:48:25.540 JupyterHub proxy:257] Adding user testuser-aa6aa5ea-64bb-4719-93c7-04557f25c3d5 to proxy /user/testuser-aa6aa5ea-64bb-4719-93c7-04557f25c3d5/ => http://192.168.79.75:... | tornado.curl_httpclient.CurlError |
async def spawn_single_user(self, user, server_name="", options=None):
# in case of error, include 'try again from /hub/home' message
if self.authenticator.refresh_pre_spawn:
auth_user = await self.refresh_auth(user, force=True)
if auth_user is None:
raise web.HTTPError(403, "auth ha... | async def spawn_single_user(self, user, server_name="", options=None):
# in case of error, include 'try again from /hub/home' message
if self.authenticator.refresh_pre_spawn:
auth_user = await self.refresh_auth(user, force=True)
if auth_user is None:
raise web.HTTPError(403, "auth ha... | https://github.com/jupyterhub/jupyterhub/issues/3060 | [E 2020-05-28 22:02:11.206 JupyterHub base:876] Failed to add michaeldzamba:doublegpu7 to proxy!
Traceback (most recent call last):
File "/fn/lib/python3.7/site-packages/jupyterhub/handlers/base.py", line 869, in finish_user_spawn
await self.proxy.add_user(user, server_name)
File "/fn/lib/python3.7/site-packages/jupyte... | TimeoutError |
async def finish_user_spawn():
"""Finish the user spawn by registering listeners and notifying the proxy.
If the spawner is slow to start, this is passed as an async callback,
otherwise it is called immediately.
"""
# wait for spawn Future
await spawn_future
toc = IOLoop.current().time()
... | async def finish_user_spawn():
"""Finish the user spawn by registering listeners and notifying the proxy.
If the spawner is slow to start, this is passed as an async callback,
otherwise it is called immediately.
"""
# wait for spawn Future
await spawn_future
toc = IOLoop.current().time()
... | https://github.com/jupyterhub/jupyterhub/issues/3060 | [E 2020-05-28 22:02:11.206 JupyterHub base:876] Failed to add michaeldzamba:doublegpu7 to proxy!
Traceback (most recent call last):
File "/fn/lib/python3.7/site-packages/jupyterhub/handlers/base.py", line 869, in finish_user_spawn
await self.proxy.add_user(user, server_name)
File "/fn/lib/python3.7/site-packages/jupyte... | TimeoutError |
def write_error(self, status_code, **kwargs):
"""Write JSON errors instead of HTML"""
exc_info = kwargs.get("exc_info")
message = ""
exception = None
status_message = responses.get(status_code, "Unknown Error")
if exc_info:
exception = exc_info[1]
# get the custom message, if def... | def write_error(self, status_code, **kwargs):
"""Write JSON errors instead of HTML"""
exc_info = kwargs.get("exc_info")
message = ""
exception = None
status_message = responses.get(status_code, "Unknown Error")
if exc_info:
exception = exc_info[1]
# get the custom message, if def... | https://github.com/jupyterhub/jupyterhub/issues/1626 | [E 2018-01-19 04:14:19.920 JupyterHub web:1518] Exception in exception handler
Traceback (most recent call last):
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", line 1516, in _execute
self._handle_request_exception(e)
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", l... | sqlalchemy.exc.StatementError |
async def update_last_activity(self):
"""Update User.last_activity timestamps from the proxy"""
routes = await self.proxy.get_all_routes()
users_count = 0
active_users_count = 0
now = datetime.utcnow()
for prefix, route in routes.items():
route_data = route["data"]
if "user" not ... | async def update_last_activity(self):
"""Update User.last_activity timestamps from the proxy"""
routes = await self.proxy.get_all_routes()
users_count = 0
active_users_count = 0
now = datetime.utcnow()
for prefix, route in routes.items():
route_data = route["data"]
if "user" not ... | https://github.com/jupyterhub/jupyterhub/issues/1626 | [E 2018-01-19 04:14:19.920 JupyterHub web:1518] Exception in exception handler
Traceback (most recent call last):
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", line 1516, in _execute
self._handle_request_exception(e)
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", l... | sqlalchemy.exc.StatementError |
def get_current_user(self):
"""get current username"""
if not hasattr(self, "_jupyterhub_user"):
try:
user = self.get_current_user_token()
if user is None:
user = self.get_current_user_cookie()
self._jupyterhub_user = user
except Exception:
... | def get_current_user(self):
"""get current username"""
user = self.get_current_user_token()
if user is not None:
return user
return self.get_current_user_cookie()
| https://github.com/jupyterhub/jupyterhub/issues/1626 | [E 2018-01-19 04:14:19.920 JupyterHub web:1518] Exception in exception handler
Traceback (most recent call last):
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", line 1516, in _execute
self._handle_request_exception(e)
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", l... | sqlalchemy.exc.StatementError |
def write_error(self, status_code, **kwargs):
"""render custom error pages"""
exc_info = kwargs.get("exc_info")
message = ""
exception = None
status_message = responses.get(status_code, "Unknown HTTP Error")
if exc_info:
exception = exc_info[1]
# get the custom message, if define... | def write_error(self, status_code, **kwargs):
"""render custom error pages"""
exc_info = kwargs.get("exc_info")
message = ""
exception = None
status_message = responses.get(status_code, "Unknown HTTP Error")
if exc_info:
exception = exc_info[1]
# get the custom message, if define... | https://github.com/jupyterhub/jupyterhub/issues/1626 | [E 2018-01-19 04:14:19.920 JupyterHub web:1518] Exception in exception handler
Traceback (most recent call last):
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", line 1516, in _execute
self._handle_request_exception(e)
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", l... | sqlalchemy.exc.StatementError |
def _notify_deleted_relationships(session, obj):
"""Expire relationships when an object becomes deleted
Needed to keep relationships up to date.
"""
mapper = inspect(obj).mapper
for prop in mapper.relationships:
if prop.back_populates:
_expire_relationship(obj, prop)
| def _notify_deleted_relationships(session, obj):
"""Expire relationships when an object becomes deleted
Needed for
"""
mapper = inspect(obj).mapper
for prop in mapper.relationships:
if prop.back_populates:
_expire_relationship(obj, prop)
| https://github.com/jupyterhub/jupyterhub/issues/1626 | [E 2018-01-19 04:14:19.920 JupyterHub web:1518] Exception in exception handler
Traceback (most recent call last):
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", line 1516, in _execute
self._handle_request_exception(e)
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", l... | sqlalchemy.exc.StatementError |
def new_session_factory(
url="sqlite:///:memory:", reset=False, expire_on_commit=False, **kwargs
):
"""Create a new session at url"""
if url.startswith("sqlite"):
kwargs.setdefault("connect_args", {"check_same_thread": False})
listeners = kwargs.setdefault("listeners", [])
listeners.... | def new_session_factory(
url="sqlite:///:memory:", reset=False, expire_on_commit=False, **kwargs
):
"""Create a new session at url"""
if url.startswith("sqlite"):
kwargs.setdefault("connect_args", {"check_same_thread": False})
listeners = kwargs.setdefault("listeners", [])
listeners.... | https://github.com/jupyterhub/jupyterhub/issues/1626 | [E 2018-01-19 04:14:19.920 JupyterHub web:1518] Exception in exception handler
Traceback (most recent call last):
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", line 1516, in _execute
self._handle_request_exception(e)
File "/Users/bhatt/anaconda3/lib/python3.6/site-packages/tornado/web.py", l... | sqlalchemy.exc.StatementError |
def validate(self, obj, value):
"""
Validate that the passed in value is a valid memory specification
It could either be a pure int, when it is taken as a byte value.
If it has one of the suffixes, it is converted into the appropriate
pure byte value.
"""
if isinstance(value, (int, float)):... | def validate(self, obj, value):
"""
Validate that the passed in value is a valid memory specification
It could either be a pure int, when it is taken as a byte value.
If it has one of the suffixes, it is converted into the appropriate
pure byte value.
"""
if isinstance(value, int):
... | https://github.com/jupyterhub/jupyterhub/issues/1089 | [E 2017-04-18 05:39:02.270 JupyterHub app:1527]
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/jupyterhub/app.py", line 1524, in launch_instance_async
yield self.initialize(argv)
File "/usr/local/lib/python3.4/dist-packages/jupyterhub/app.py", line 1315, in initialize
yield self.init_sp... | ValueError |
def init_spawners(self):
db = self.db
user_summaries = [""]
def _user_summary(user):
parts = ["{0: >8}".format(user.name)]
if user.admin:
parts.append("admin")
for name, spawner in sorted(user.spawners.items(), key=itemgetter(0)):
if spawner.server:
... | def init_spawners(self):
db = self.db
user_summaries = [""]
def _user_summary(user):
parts = ["{0: >8}".format(user.name)]
if user.admin:
parts.append("admin")
for name, spawner in sorted(user.spawners.items(), key=itemgetter(0)):
if spawner.server:
... | https://github.com/jupyterhub/jupyterhub/issues/1414 | singleuser.cmd jupyterhub-singleuser
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/jupyterhub/app.py", line 1623, in launch_instance_async
yield self.initialize(argv)
File "/usr/lib/python3.5/types.py", line 179, in throw
return self.__wrapped.throw(tp, *rest)
File "/usr/local/lib/pyth... | sqlalchemy.exc.IntegrityError |
def stop(self):
"""Stop a managed service"""
if not self.managed:
raise RuntimeError("Cannot stop unmanaged service %s" % self)
if self.spawner:
if self.orm.server:
self.db.delete(self.orm.server)
self.db.commit()
self.spawner.stop_polling()
return sel... | def stop(self):
"""Stop a managed service"""
if not self.managed:
raise RuntimeError("Cannot stop unmanaged service %s" % self)
if self.spawner:
self.spawner.stop_polling()
return self.spawner.stop()
| https://github.com/jupyterhub/jupyterhub/issues/1414 | singleuser.cmd jupyterhub-singleuser
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/jupyterhub/app.py", line 1623, in launch_instance_async
yield self.initialize(argv)
File "/usr/lib/python3.5/types.py", line 179, in throw
return self.__wrapped.throw(tp, *rest)
File "/usr/local/lib/pyth... | sqlalchemy.exc.IntegrityError |
def get(self, token):
orm_token = orm.APIToken.find(self.db, token)
if orm_token is None:
orm_token = orm.OAuthAccessToken.find(self.db, token)
if orm_token is None:
raise web.HTTPError(404)
if orm_token.user:
model = self.user_model(self.users[orm_token.user])
elif orm_token... | def get(self, token):
orm_token = orm.APIToken.find(self.db, token)
if orm_token is None:
orm_token = orm.OAuthAccessToken.find(self.db, token)
if orm_token is None:
raise web.HTTPError(404)
if orm_token.user:
model = self.user_model(self.users[orm_token.user])
elif orm_token... | https://github.com/jupyterhub/jupyterhub/issues/1309 | Traceback (most recent call last):
File "/usr/lib64/python3.4/site-packages/tornado/web.py", line 1509, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/usr/lib/python3.4/site-packages/jupyterhub/utils.py", line 193, in decorated
return method(self, *args, **kwargs)
File "/usr/lib/python3.4/site-... | AttributeError |
def save_token(self, access_token):
"""
Stores an access token in the database.
:param access_token: An instance of :class:`oauth2.datatype.AccessToken`.
"""
user = self.db.query(orm.User).filter(orm.User.id == access_token.user_id).first()
if user is None:
raise ValueError("No user f... | def save_token(self, access_token):
"""
Stores an access token in the database.
:param access_token: An instance of :class:`oauth2.datatype.AccessToken`.
"""
user = self.db.query(orm.User).filter(orm.User.id == access_token.user_id).first()
orm_access_token = orm.OAuthAccessToken(
cli... | https://github.com/jupyterhub/jupyterhub/issues/1309 | Traceback (most recent call last):
File "/usr/lib64/python3.4/site-packages/tornado/web.py", line 1509, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/usr/lib/python3.4/site-packages/jupyterhub/utils.py", line 193, in decorated
return method(self, *args, **kwargs)
File "/usr/lib/python3.4/site-... | AttributeError |
def upgrade():
# proxy/table info is no longer in the database
op.drop_table("proxies")
op.drop_table("hubs")
# drop some columns no longer in use
try:
op.drop_column("users", "auth_state")
op.drop_column("users", "_server_id")
except sa.exc.OperationalError:
# this won'... | def upgrade():
try:
op.drop_column("users", "auth_state")
except sa.exc.OperationalError as e:
# sqlite3 can't drop columns
warnings.warn("Failed to drop column: %s" % e)
op.add_column("users", sa.Column("encrypted_auth_state", sa.types.LargeBinary))
| https://github.com/jupyterhub/jupyterhub/issues/1162 | $ jupyterhub
...
$ jupyterhub upgrade-db
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> 19c0846f6344, base revision for 0.5
INFO [alembic.runtime.migration] Running upgrade 19c0846f634... | sqlite3.OperationalError |
def downgrade():
# drop all the new tables
engine = op.get_bind().engine
for table in ("oauth_clients", "oauth_codes", "oauth_access_tokens", "spawners"):
if engine.has_table(table):
op.drop_table(table)
op.drop_column("users", "encrypted_auth_state")
op.add_column("users", sa.... | def downgrade():
op.drop_column("users", "encrypted_auth_state")
op.add_column("users", sa.Column("auth_state", JSONDict))
| https://github.com/jupyterhub/jupyterhub/issues/1162 | $ jupyterhub
...
$ jupyterhub upgrade-db
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> 19c0846f6344, base revision for 0.5
INFO [alembic.runtime.migration] Running upgrade 19c0846f634... | sqlite3.OperationalError |
def start(self):
hub = JupyterHub(parent=self)
hub.load_config_file(hub.config_file)
self.log = hub.log
if hub.db_url.startswith("sqlite:///"):
db_file = hub.db_url.split(":///", 1)[1]
self._backup_db_file(db_file)
self.log.info("Upgrading %s", hub.db_url)
dbutil.upgrade(hub.db_u... | def start(self):
hub = JupyterHub(parent=self)
hub.load_config_file(hub.config_file)
if hub.db_url.startswith("sqlite:///"):
db_file = hub.db_url.split(":///", 1)[1]
self._backup_db_file(db_file)
self.log.info("Upgrading %s", hub.db_url)
dbutil.upgrade(hub.db_url)
| https://github.com/jupyterhub/jupyterhub/issues/1162 | $ jupyterhub
...
$ jupyterhub upgrade-db
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> 19c0846f6344, base revision for 0.5
INFO [alembic.runtime.migration] Running upgrade 19c0846f634... | sqlite3.OperationalError |
def init_db(self):
"""Create the database connection"""
self.log.debug("Connecting to db: %s", self.db_url)
try:
self.session_factory = orm.new_session_factory(
self.db_url, reset=self.reset_db, echo=self.debug_db, **self.db_kwargs
)
# trigger constructing thread local db... | def init_db(self):
"""Create the database connection"""
self.log.debug("Connecting to db: %s", self.db_url)
try:
self.session_factory = orm.new_session_factory(
self.db_url, reset=self.reset_db, echo=self.debug_db, **self.db_kwargs
)
# trigger constructing thread local db... | https://github.com/jupyterhub/jupyterhub/issues/1162 | $ jupyterhub
...
$ jupyterhub upgrade-db
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> 19c0846f6344, base revision for 0.5
INFO [alembic.runtime.migration] Running upgrade 19c0846f634... | sqlite3.OperationalError |
def new_session_factory(url="sqlite:///:memory:", reset=False, **kwargs):
"""Create a new session at url"""
if url.startswith("sqlite"):
kwargs.setdefault("connect_args", {"check_same_thread": False})
elif url.startswith("mysql"):
kwargs.setdefault("pool_recycle", 60)
if url.endswith(":... | def new_session_factory(url="sqlite:///:memory:", reset=False, **kwargs):
"""Create a new session at url"""
if url.startswith("sqlite"):
kwargs.setdefault("connect_args", {"check_same_thread": False})
elif url.startswith("mysql"):
kwargs.setdefault("pool_recycle", 60)
if url.endswith(":... | https://github.com/jupyterhub/jupyterhub/issues/1162 | $ jupyterhub
...
$ jupyterhub upgrade-db
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> 19c0846f6344, base revision for 0.5
INFO [alembic.runtime.migration] Running upgrade 19c0846f634... | sqlite3.OperationalError |
def start(self):
"""Start a managed service"""
if not self.managed:
raise RuntimeError("Cannot start unmanaged service %s" % self)
self.log.info("Starting service %r: %r", self.name, self.command)
env = {}
env.update(self.environment)
env["JUPYTERHUB_SERVICE_NAME"] = self.name
env["... | def start(self):
"""Start a managed service"""
if not self.managed:
raise RuntimeError("Cannot start unmanaged service %s" % self)
self.log.info("Starting service %r: %r", self.name, self.command)
env = {}
env.update(self.environment)
env["JUPYTERHUB_SERVICE_NAME"] = self.name
env["... | https://github.com/jupyterhub/jupyterhub/issues/765 | [C 2016-09-20 02:28:37.026 JupyterHub app:1444] Failed to start service cull-idle
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/jupyterhub/app.py", line 1442, in start
yield service.start()
File "/usr/local/lib/python3.5/dist-packages/jupyterhub/services/service.py", line 228, in start... | AttributeError |
def get_init_detail(self, params=None, user=None):
"""
At the end of the initialization we return the certificate and the
PKCS12 file, if the private key exists.
"""
response_detail = TokenClass.get_init_detail(self, params, user)
params = params or {}
certificate = self.get_tokeninfo("certi... | def get_init_detail(self, params=None, user=None):
"""
At the end of the initialization we return the certificate and the
PKCS12 file, if the private key exists.
"""
response_detail = TokenClass.get_init_detail(self, params, user)
params = params or {}
certificate = self.get_tokeninfo("certi... | https://github.com/privacyidea/privacyidea/issues/1799 | [2019-08-19 16:06:52,849] ERROR in app: Exception on /token/init [POST]
Traceback (most recent call last):
File "/home/fred/privacyidea/privacyidea/venv3/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/fred/privacyidea/privacyidea/venv3/lib/python3.7... | TypeError |
def get_as_dict(self):
"""
This returns the token data as a dictionary.
It is used to display the token list at /token/list.
The certificate token can add the PKCS12 file if it exists
:return: The token data as dict
:rtype: dict
"""
# first get the database values as dict
token_dic... | def get_as_dict(self):
"""
This returns the token data as a dictionary.
It is used to display the token list at /token/list.
The certificate token can add the PKCS12 file if it exists
:return: The token data as dict
:rtype: dict
"""
# first get the database values as dict
token_dic... | https://github.com/privacyidea/privacyidea/issues/1799 | [2019-08-19 16:06:52,849] ERROR in app: Exception on /token/init [POST]
Traceback (most recent call last):
File "/home/fred/privacyidea/privacyidea/venv3/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/fred/privacyidea/privacyidea/venv3/lib/python3.7... | TypeError |
def upgrade():
try:
op.create_table(
"tokenowner",
sa.Column("id", sa.Integer()),
sa.Column("token_id", sa.Integer(), nullable=True),
sa.Column("resolver", sa.Unicode(length=120), nullable=True),
sa.Column("user_id", sa.Unicode(length=320), nullabl... | def upgrade():
try:
op.create_table(
"tokenowner",
sa.Column("id", sa.Integer()),
sa.Column("token_id", sa.Integer(), nullable=True),
sa.Column("resolver", sa.Unicode(length=120), nullable=True),
sa.Column("user_id", sa.Unicode(length=320), nullabl... | https://github.com/privacyidea/privacyidea/issues/1461 | ERROR [sqlalchemy.pool.QueuePool] Exception during reset or similar
Traceback (most recent call last):
File "/opt/venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 742, in _finalize_fairy
fairy._reset(pool)
File "/opt/venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 927, in _reset
self._reset_agent.r... | OperationalError |
def reload_from_db(self):
"""
Read the timestamp from the database. If the timestamp is newer than
the internal timestamp, then read the complete data
:return:
"""
if (
not self.timestamp
or self.timestamp
+ datetime.timedelta(
seconds=current_app.config.get("... | def reload_from_db(self):
"""
Read the timestamp from the database. If the timestamp is newer than
the internal timestamp, then read the complete data
:return:
"""
if (
not self.timestamp
or self.timestamp
+ datetime.timedelta(
seconds=current_app.config.get("... | https://github.com/privacyidea/privacyidea/issues/1181 | [2018-08-14 14:49:53,123] ERROR in app: Exception on /system/documentation [GET]
Traceback (most recent call last):
File "/home/fred/privacyidea/privacyidea/venv/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/fred/privacyidea/privacyidea/venv/lib/py... | UnicodeDecodeError |
def get_config(self, key=None, default=None, role="admin", return_bool=False):
"""
:param key: A key to retrieve
:type key: string
:param default: The default value, if it does not exist in the database
:param role: The role which wants to retrieve the system config. Can be
"admin" or "publi... | def get_config(self, key=None, default=None, role="admin", return_bool=False):
"""
:param key: A key to retrieve
:type key: string
:param default: The default value, if it does not exist in the database
:param role: The role which wants to retrieve the system config. Can be
"admin" or "publi... | https://github.com/privacyidea/privacyidea/issues/1181 | [2018-08-14 14:49:53,123] ERROR in app: Exception on /system/documentation [GET]
Traceback (most recent call last):
File "/home/fred/privacyidea/privacyidea/venv/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/fred/privacyidea/privacyidea/venv/lib/py... | UnicodeDecodeError |
def decryptPassword(cryptPass, convert_unicode=False):
"""
Decrypt the encrypted password ``cryptPass`` and return it.
If an error occurs during decryption, return FAILED_TO_DECRYPT_PASSWORD.
:param cryptPass: bytestring
:param convert_unicode: If true, interpret the decrypted password as an UTF-8 ... | def decryptPassword(cryptPass):
hsm = _get_hsm()
try:
ret = hsm.decrypt_password(cryptPass)
except Exception as exx: # pragma: no cover
log.warning(exx)
ret = FAILED_TO_DECRYPT_PASSWORD
return ret
| https://github.com/privacyidea/privacyidea/issues/1181 | [2018-08-14 14:49:53,123] ERROR in app: Exception on /system/documentation [GET]
Traceback (most recent call last):
File "/home/fred/privacyidea/privacyidea/venv/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/fred/privacyidea/privacyidea/venv/lib/py... | UnicodeDecodeError |
def _create_engine(self):
log.info(
"using the connect string {0!s}".format(
censor_connect_string(self.connect_string)
)
)
try:
log.debug(
"using pool_size={0!s}, pool_timeout={1!s}, pool_recycle={2!s}".format(
self.pool_size, self.pool_timeou... | def _create_engine(self):
log.info(
"using the connect string {0!s}".format(
censor_connect_string(self.connect_string)
)
)
try:
log.debug(
"using pool_size={0!s}, pool_timeout={1!s}, pool_recycle={2!s}".format(
self.pool_size, self.pool_timeou... | https://github.com/privacyidea/privacyidea/issues/1181 | [2018-08-14 14:49:53,123] ERROR in app: Exception on /system/documentation [GET]
Traceback (most recent call last):
File "/home/fred/privacyidea/privacyidea/venv/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/fred/privacyidea/privacyidea/venv/lib/py... | UnicodeDecodeError |
def _create_connect_string(param):
"""
create the connectstring
Port, Password, conParams, Driver, User,
Server, Database
"""
port = ""
password = ""
conParams = ""
if param.get("Port"):
port = ":{0!s}".format(param.get("Port"))
if param.get("Password"):
password... | def _create_connect_string(param):
"""
create the connectstring
Port, Password, conParams, Driver, User,
Server, Database
"""
port = ""
password = ""
conParams = ""
if param.get("Port"):
port = ":{0!s}".format(param.get("Port"))
if param.get("Password"):
password... | https://github.com/privacyidea/privacyidea/issues/1181 | [2018-08-14 14:49:53,123] ERROR in app: Exception on /system/documentation [GET]
Traceback (most recent call last):
File "/home/fred/privacyidea/privacyidea/venv/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/fred/privacyidea/privacyidea/venv/lib/py... | UnicodeDecodeError |
def getUserInfo(self, userId):
"""
This function returns all user info for a given userid/object.
:param userId: The userid of the object
:type userId: string
:return: A dictionary with the keys defined in self.userinfo
:rtype: dict
"""
ret = {}
self._bind()
if self.uidtype.low... | def getUserInfo(self, userId):
"""
This function returns all user info for a given userid/object.
:param userId: The userid of the object
:type userId: string
:return: A dictionary with the keys defined in self.userinfo
:rtype: dict
"""
ret = {}
self._bind()
if self.uidtype.low... | https://github.com/privacyidea/privacyidea/issues/385 | Found this userlist: [...list of users...]
Found this userlist: [...list of users...]
Exiting get_user_list with result [...list of users...]
Exiting get_user_list with result [...list of users...]
Exception on /user/ [GET]
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/flask/app.py", line ... | UnicodeDecodeError |
def decryptPassword(cryptPass):
hsm = _get_hsm()
try:
ret = hsm.decrypt_password(cryptPass)
except Exception as exx: # pragma: no cover
log.warning(exx)
ret = FAILED_TO_DECRYPT_PASSWORD
return ret
| def decryptPassword(cryptPass):
hsm = _get_hsm()
try:
ret = hsm.decrypt_password(cryptPass)
except Exception as exx: # pragma: no cover
log.warning(exx)
ret = "FAILED TO DECRYPT PASSWORD!"
return ret
| https://github.com/privacyidea/privacyidea/issues/350 | SMTPAuthenticationError: (535, '5.7.8 Error: authentication failed:')
[2016-03-28 19:55:39,479][30338][140453494273792][WARNING][privacyidea.lib.crypto:326] 'NoneType' object has no attribute 'find'
[2016-03-28 19:55:41,528][30338][140453494273792][ERROR][privacyidea.app:1423] Exception on /smtpserver/send_test_email [... | SMTPAuthenticationError |
def _display_as_base(cls):
"""
A decorator that makes an exception class look like its base.
We use this to hide subclasses that are implementation details - the user
should catch the base type, which is what the traceback will show them.
Classes decorated with this decorator are subject to remova... | def _display_as_base(cls):
"""
A decorator that makes an exception class look like its base.
We use this to hide subclasses that are implementation details - the user
should catch the base type, which is what the traceback will show them.
Classes decorated with this decorator are subject to remova... | https://github.com/numpy/numpy/issues/16490 | Traceback (most recent call last):
File "ufunctypeerror.py", line 6, in <module>
numpy.ones(1) * "foo"
numpy.core._exceptions.UFuncTypeError: ufunc 'multiply' did not contain a loop with signature matching types (dtype('<U32'), dtype('<U32')) -> dtype('<U32')
During handling of the above exception, another exception o... | numpy.core._exceptions.UFuncTypeError |
def _raw_fft(a, n, axis, is_real, is_forward, inv_norm):
axis = normalize_axis_index(axis, a.ndim)
if n is None:
n = a.shape[axis]
if n < 1:
raise ValueError("Invalid number of FFT data points (%d) specified." % n)
fct = 1 / inv_norm
if a.shape[axis] != n:
s = list(a.shape... | def _raw_fft(a, n, axis, is_real, is_forward, fct):
axis = normalize_axis_index(axis, a.ndim)
if n is None:
n = a.shape[axis]
if n < 1:
raise ValueError("Invalid number of FFT data points (%d) specified." % n)
if a.shape[axis] != n:
s = list(a.shape)
if s[axis] > n:
... | https://github.com/numpy/numpy/issues/14176 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<__array_function__ internals>", line 6, in ifft
File "/home/peter/.local/lib/python3.7/site-packages/numpy/fft/pocketfft.py", line 274, in ifft
fct = 1/n
ZeroDivisionError: division by zero | ZeroDivisionError |
def fft(a, n=None, axis=-1, norm=None):
"""
Compute the one-dimensional discrete Fourier Transform.
This function computes the one-dimensional *n*-point discrete Fourier
Transform (DFT) with the efficient Fast Fourier Transform (FFT)
algorithm [CT].
Parameters
----------
a : array_like... | def fft(a, n=None, axis=-1, norm=None):
"""
Compute the one-dimensional discrete Fourier Transform.
This function computes the one-dimensional *n*-point discrete Fourier
Transform (DFT) with the efficient Fast Fourier Transform (FFT)
algorithm [CT].
Parameters
----------
a : array_like... | https://github.com/numpy/numpy/issues/14176 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<__array_function__ internals>", line 6, in ifft
File "/home/peter/.local/lib/python3.7/site-packages/numpy/fft/pocketfft.py", line 274, in ifft
fct = 1/n
ZeroDivisionError: division by zero | ZeroDivisionError |
def ifft(a, n=None, axis=-1, norm=None):
"""
Compute the one-dimensional inverse discrete Fourier Transform.
This function computes the inverse of the one-dimensional *n*-point
discrete Fourier transform computed by `fft`. In other words,
``ifft(fft(a)) == a`` to within numerical accuracy.
For... | def ifft(a, n=None, axis=-1, norm=None):
"""
Compute the one-dimensional inverse discrete Fourier Transform.
This function computes the inverse of the one-dimensional *n*-point
discrete Fourier transform computed by `fft`. In other words,
``ifft(fft(a)) == a`` to within numerical accuracy.
For... | https://github.com/numpy/numpy/issues/14176 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<__array_function__ internals>", line 6, in ifft
File "/home/peter/.local/lib/python3.7/site-packages/numpy/fft/pocketfft.py", line 274, in ifft
fct = 1/n
ZeroDivisionError: division by zero | ZeroDivisionError |
def rfft(a, n=None, axis=-1, norm=None):
"""
Compute the one-dimensional discrete Fourier Transform for real input.
This function computes the one-dimensional *n*-point discrete Fourier
Transform (DFT) of a real-valued array by means of an efficient algorithm
called the Fast Fourier Transform (FFT)... | def rfft(a, n=None, axis=-1, norm=None):
"""
Compute the one-dimensional discrete Fourier Transform for real input.
This function computes the one-dimensional *n*-point discrete Fourier
Transform (DFT) of a real-valued array by means of an efficient algorithm
called the Fast Fourier Transform (FFT)... | https://github.com/numpy/numpy/issues/14176 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<__array_function__ internals>", line 6, in ifft
File "/home/peter/.local/lib/python3.7/site-packages/numpy/fft/pocketfft.py", line 274, in ifft
fct = 1/n
ZeroDivisionError: division by zero | ZeroDivisionError |
def irfft(a, n=None, axis=-1, norm=None):
"""
Compute the inverse of the n-point DFT for real input.
This function computes the inverse of the one-dimensional *n*-point
discrete Fourier Transform of real input computed by `rfft`.
In other words, ``irfft(rfft(a), len(a)) == a`` to within numerical
... | def irfft(a, n=None, axis=-1, norm=None):
"""
Compute the inverse of the n-point DFT for real input.
This function computes the inverse of the one-dimensional *n*-point
discrete Fourier Transform of real input computed by `rfft`.
In other words, ``irfft(rfft(a), len(a)) == a`` to within numerical
... | https://github.com/numpy/numpy/issues/14176 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<__array_function__ internals>", line 6, in ifft
File "/home/peter/.local/lib/python3.7/site-packages/numpy/fft/pocketfft.py", line 274, in ifft
fct = 1/n
ZeroDivisionError: division by zero | ZeroDivisionError |
def __init__(
self, pyfunc, otypes=None, doc=None, excluded=None, cache=False, signature=None
):
self.pyfunc = pyfunc
self.cache = cache
self.signature = signature
self._ufunc = {} # Caching to improve default performance
if doc is None:
self.__doc__ = pyfunc.__doc__
else:
... | def __init__(
self, pyfunc, otypes=None, doc=None, excluded=None, cache=False, signature=None
):
self.pyfunc = pyfunc
self.cache = cache
self.signature = signature
self._ufunc = None # Caching to improve default performance
if doc is None:
self.__doc__ = pyfunc.__doc__
else:
... | https://github.com/numpy/numpy/issues/16120 | Traceback (most recent call last):
File "function.py", line 17, in <module>
g(np.arange(3.0)) # Crash!
File "/home/hylke/.local/lib/python3.8/site-packages/numpy/lib/function_base.py", line 2091, in __call__
return self._vectorize_call(func=func, args=vargs)
File "/home/hylke/.local/lib/python3.8/site-packages/numpy/l... | ValueError |
def _get_ufunc_and_otypes(self, func, args):
"""Return (ufunc, otypes)."""
# frompyfunc will fail if args is empty
if not args:
raise ValueError("args can not be empty")
if self.otypes is not None:
otypes = self.otypes
# self._ufunc is a dictionary whose keys are the number of
... | def _get_ufunc_and_otypes(self, func, args):
"""Return (ufunc, otypes)."""
# frompyfunc will fail if args is empty
if not args:
raise ValueError("args can not be empty")
if self.otypes is not None:
otypes = self.otypes
nout = len(otypes)
# Note logic here: We only *use*... | https://github.com/numpy/numpy/issues/16120 | Traceback (most recent call last):
File "function.py", line 17, in <module>
g(np.arange(3.0)) # Crash!
File "/home/hylke/.local/lib/python3.8/site-packages/numpy/lib/function_base.py", line 2091, in __call__
return self._vectorize_call(func=func, args=vargs)
File "/home/hylke/.local/lib/python3.8/site-packages/numpy/l... | ValueError |
def __getitem__(self, indx):
"""
x.__getitem__(y) <==> x[y]
Return the item described by i, as a masked array.
"""
# We could directly use ndarray.__getitem__ on self.
# But then we would have to modify __array_finalize__ to prevent the
# mask of being reshaped if it hasn't been set up pro... | def __getitem__(self, indx):
"""
x.__getitem__(y) <==> x[y]
Return the item described by i, as a masked array.
"""
# We could directly use ndarray.__getitem__ on self.
# But then we would have to modify __array_finalize__ to prevent the
# mask of being reshaped if it hasn't been set up pro... | https://github.com/numpy/numpy/issues/15895 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python37\lib\site-packages\numpy\ma\core.py", line 3276, in __getitem__
if dout._fill_value.ndim > 0:
AttributeError: 'str' object has no attribute 'ndim' | AttributeError |
def _replace_nan(a, val):
"""
If `a` is of inexact type, make a copy of `a`, replace NaNs with
the `val` value, and return the copy together with a boolean mask
marking the locations where NaNs were present. If `a` is not of
inexact type, do nothing and return `a` together with a mask of None.
... | def _replace_nan(a, val):
"""
If `a` is of inexact type, make a copy of `a`, replace NaNs with
the `val` value, and return the copy together with a boolean mask
marking the locations where NaNs were present. If `a` is not of
inexact type, do nothing and return `a` together with a mask of None.
... | https://github.com/numpy/numpy/issues/9008 | In [2]: import numpy as np
In [3]: np.__version__
Out[3]: '1.13.0.dev0+bca7922'
In [4]: a = np.array([[1.0, 2.0], [3.0, 4.0]], dtype=object)
In [5]: np.nanmax(a, axis=0)
---------------------------------------------------------------------------
TypeError Traceback (most recent call l... | TypeError |
def nanmin(a, axis=None, out=None, keepdims=np._NoValue):
"""
Return minimum of an array or minimum along an axis, ignoring any NaNs.
When all-NaN slices are encountered a ``RuntimeWarning`` is raised and
Nan is returned for that slice.
Parameters
----------
a : array_like
Array con... | def nanmin(a, axis=None, out=None, keepdims=np._NoValue):
"""
Return minimum of an array or minimum along an axis, ignoring any NaNs.
When all-NaN slices are encountered a ``RuntimeWarning`` is raised and
Nan is returned for that slice.
Parameters
----------
a : array_like
Array con... | https://github.com/numpy/numpy/issues/9008 | In [2]: import numpy as np
In [3]: np.__version__
Out[3]: '1.13.0.dev0+bca7922'
In [4]: a = np.array([[1.0, 2.0], [3.0, 4.0]], dtype=object)
In [5]: np.nanmax(a, axis=0)
---------------------------------------------------------------------------
TypeError Traceback (most recent call l... | TypeError |
def nanmax(a, axis=None, out=None, keepdims=np._NoValue):
"""
Return the maximum of an array or maximum along an axis, ignoring any
NaNs. When all-NaN slices are encountered a ``RuntimeWarning`` is
raised and NaN is returned for that slice.
Parameters
----------
a : array_like
Arra... | def nanmax(a, axis=None, out=None, keepdims=np._NoValue):
"""
Return the maximum of an array or maximum along an axis, ignoring any
NaNs. When all-NaN slices are encountered a ``RuntimeWarning`` is
raised and NaN is returned for that slice.
Parameters
----------
a : array_like
Arra... | https://github.com/numpy/numpy/issues/9008 | In [2]: import numpy as np
In [3]: np.__version__
Out[3]: '1.13.0.dev0+bca7922'
In [4]: a = np.array([[1.0, 2.0], [3.0, 4.0]], dtype=object)
In [5]: np.nanmax(a, axis=0)
---------------------------------------------------------------------------
TypeError Traceback (most recent call l... | TypeError |
def norm(x, ord=None, axis=None, keepdims=False):
"""
Matrix or vector norm.
This function is able to return one of eight different matrix norms,
or one of an infinite number of vector norms (described below), depending
on the value of the ``ord`` parameter.
Parameters
----------
x : a... | def norm(x, ord=None, axis=None, keepdims=False):
"""
Matrix or vector norm.
This function is able to return one of eight different matrix norms,
or one of an infinite number of vector norms (described below), depending
on the value of the ``ord`` parameter.
Parameters
----------
x : a... | https://github.com/numpy/numpy/issues/15533 | 1.7594677278427366
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
//anaconda3/lib/python3.7/site-packages/numpy/linalg/linalg.py in norm(x, ord, axis, keepdims)
2515 try:
-> 2516 ord + 1
... | TypeError |
def binary_repr(num, width=None):
"""
Return the binary representation of the input number as a string.
For negative numbers, if width is not given, a minus sign is added to the
front. If width is given, the two's complement of the number is
returned, with respect to that width.
In a two's-com... | def binary_repr(num, width=None):
"""
Return the binary representation of the input number as a string.
For negative numbers, if width is not given, a minus sign is added to the
front. If width is given, the two's complement of the number is
returned, with respect to that width.
In a two's-com... | https://github.com/numpy/numpy/issues/14289 | System info:
3.6.8rc1 (v3.6.8rc1:cc3e73212a, Dec 11 2018, 17:37:34)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
NumPy version: 1.17.0
val = -2305843009213693952
Python int: 1110000000000000000000000000000000000000000000000000000000000000
NumPy int64: 1110000000000000000000000000000000000000000000000000000... | TypeError |
def __new__(subtype, filename, dtype=uint8, mode="r+", offset=0, shape=None, order="C"):
# Import here to minimize 'import numpy' overhead
import mmap
import os.path
try:
mode = mode_equivalents[mode]
except KeyError:
if mode not in valid_filemodes:
raise ValueError(
... | def __new__(subtype, filename, dtype=uint8, mode="r+", offset=0, shape=None, order="C"):
# Import here to minimize 'import numpy' overhead
import mmap
import os.path
try:
mode = mode_equivalents[mode]
except KeyError:
if mode not in valid_filemodes:
raise ValueError(
... | https://github.com/numpy/numpy/issues/12653 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/numpy/core/memmap.py", line 250, in __new__
fid.seek(bytes - 1, 0)
OSError: [Errno 22] Invalid argument | OSError |
def _exec_command(command, use_shell=None, use_tee=None, **env):
log.debug("_exec_command(...)")
if use_shell is None:
use_shell = os.name == "posix"
if use_tee is None:
use_tee = os.name == "posix"
using_command = 0
if use_shell:
# We use shell (unless use_shell==0) so that... | def _exec_command(command, use_shell=None, use_tee=None, **env):
log.debug("_exec_command(...)")
if use_shell is None:
use_shell = os.name == "posix"
if use_tee is None:
use_tee = os.name == "posix"
using_command = 0
if use_shell:
# We use shell (unless use_shell==0) so that... | https://github.com/numpy/numpy/issues/7607 | Traceback (most recent call last):
File "\cygwin64\home\biolab\spawnve.py", line 46, in run
print(exec_command([self.executable] + self.args + [str(i)]))
File "C:\Python35-32\lib\site-packages\numpy\distutils\exec_command.py", line
235, in exec_command
use_tee=use_tee,**env)
File "C:\Python35-32\lib\site-packages\numpy... | PermissionError |
def _ctype_ndarray(element_type, shape):
"""Create an ndarray of the given element type and shape"""
for dim in shape[::-1]:
element_type = dim * element_type
# prevent the type name include np.ctypeslib
element_type.__module__ = None
return element_type
| def _ctype_ndarray(element_type, shape):
"""Create an ndarray of the given element type and shape"""
for dim in shape[::-1]:
element_type = element_type * dim
return element_type
| https://github.com/numpy/numpy/issues/6176 | KeyError Traceback (most recent call last)
<ipython-input-3-e5712fdde6f3> in <module>()
----> 1 b = np.ctypeslib.as_ctypes(a)
/home/chug/.local/lib/python2.7/site-packages/numpy/ctypeslib.py in as_ctypes(obj)
419 if readonly:
420 raise TypeError("readonly arrays uns... | KeyError |
def as_ctypes(obj):
"""Create and return a ctypes object from a numpy array. Actually
anything that exposes the __array_interface__ is accepted."""
ai = obj.__array_interface__
if ai["strides"]:
raise TypeError("strided arrays not supported")
if ai["version"] != 3:
raise TypeError("... | def as_ctypes(obj):
"""Create and return a ctypes object from a numpy array. Actually
anything that exposes the __array_interface__ is accepted."""
ai = obj.__array_interface__
if ai["strides"]:
raise TypeError("strided arrays not supported")
if ai["version"] != 3:
raise TypeError("... | https://github.com/numpy/numpy/issues/6176 | KeyError Traceback (most recent call last)
<ipython-input-3-e5712fdde6f3> in <module>()
----> 1 b = np.ctypeslib.as_ctypes(a)
/home/chug/.local/lib/python2.7/site-packages/numpy/ctypeslib.py in as_ctypes(obj)
419 if readonly:
420 raise TypeError("readonly arrays uns... | KeyError |
def _read_array_header(fp, version):
"""
see read_array_header_1_0
"""
# Read an unsigned, little-endian short int which has the length of the
# header.
import struct
if version == (1, 0):
hlength_type = "<H"
elif version == (2, 0):
hlength_type = "<I"
else:
... | def _read_array_header(fp, version):
"""
see read_array_header_1_0
"""
# Read an unsigned, little-endian short int which has the length of the
# header.
import struct
if version == (1, 0):
hlength_type = "<H"
elif version == (2, 0):
hlength_type = "<I"
else:
... | https://github.com/numpy/numpy/issues/2215 | import numpy as np
t = np.dtype('i1, i4, i1', align=True)
d = np.zeros(1, t)
np.save("test.npy", d)
data = np.load("test.npy")
Traceback (most recent call last):
File "D:\Projects\Cuda\Cuda_Git\pathwise\liinc\model\feeds\numpy_bug.py", line 8, in <module>
data = np.load("test.npy")
File "D:\Projects\Cuda\Cuda_Git\p... | ValueError |
def array_repr(arr, max_line_width=None, precision=None, suppress_small=None):
"""
Return the string representation of an array.
Parameters
----------
arr : ndarray
Input array.
max_line_width : int, optional
The maximum number of columns the string should span. Newline
... | def array_repr(arr, max_line_width=None, precision=None, suppress_small=None):
"""
Return the string representation of an array.
Parameters
----------
arr : ndarray
Input array.
max_line_width : int, optional
The maximum number of columns the string should span. Newline
... | https://github.com/numpy/numpy/issues/12162 | In [1]: import numpy as np
In [2]: class Sub(np.ndarray):
...: def __array_function__(*args, **kwargs):
...: return NotImplemented
...:
In [3]: repr(np.array(1).view(Sub))
---------------------------------------------------------------------------
TypeError Traceback (most ... | TypeError |
def array_str(a, max_line_width=None, precision=None, suppress_small=None):
"""
Return a string representation of the data in an array.
The data in the array is returned as a single string. This function is
similar to `array_repr`, the difference being that `array_repr` also
returns information on... | def array_str(a, max_line_width=None, precision=None, suppress_small=None):
"""
Return a string representation of the data in an array.
The data in the array is returned as a single string. This function is
similar to `array_repr`, the difference being that `array_repr` also
returns information on... | https://github.com/numpy/numpy/issues/12162 | In [1]: import numpy as np
In [2]: class Sub(np.ndarray):
...: def __array_function__(*args, **kwargs):
...: return NotImplemented
...:
In [3]: repr(np.array(1).view(Sub))
---------------------------------------------------------------------------
TypeError Traceback (most ... | TypeError |
def set_string_function(f, repr=True):
"""
Set a Python function to be used when pretty printing arrays.
Parameters
----------
f : function or None
Function to be used to pretty print arrays. The function should expect
a single array argument and return a string of the representatio... | def set_string_function(f, repr=True):
"""
Set a Python function to be used when pretty printing arrays.
Parameters
----------
f : function or None
Function to be used to pretty print arrays. The function should expect
a single array argument and return a string of the representatio... | https://github.com/numpy/numpy/issues/12162 | In [1]: import numpy as np
In [2]: class Sub(np.ndarray):
...: def __array_function__(*args, **kwargs):
...: return NotImplemented
...:
In [3]: repr(np.array(1).view(Sub))
---------------------------------------------------------------------------
TypeError Traceback (most ... | TypeError |
def array_function_dispatch(dispatcher, module=None, verify=True):
"""Decorator for adding dispatch with the __array_function__ protocol."""
def decorator(implementation):
# TODO: only do this check when the appropriate flag is enabled or for
# a dev install. We want this check for testing but ... | def array_function_dispatch(dispatcher, module=None, verify=True):
"""Decorator for adding dispatch with the __array_function__ protocol."""
def decorator(implementation):
# TODO: only do this check when the appropriate flag is enabled or for
# a dev install. We want this check for testing but ... | https://github.com/numpy/numpy/issues/12162 | In [1]: import numpy as np
In [2]: class Sub(np.ndarray):
...: def __array_function__(*args, **kwargs):
...: return NotImplemented
...:
In [3]: repr(np.array(1).view(Sub))
---------------------------------------------------------------------------
TypeError Traceback (most ... | TypeError |
def decorator(implementation):
# TODO: only do this check when the appropriate flag is enabled or for
# a dev install. We want this check for testing but don't want to
# slow down all numpy imports.
if verify:
verify_matching_signatures(implementation, dispatcher)
@functools.wraps(implement... | def decorator(implementation):
# TODO: only do this check when the appropriate flag is enabled or for
# a dev install. We want this check for testing but don't want to
# slow down all numpy imports.
if verify:
verify_matching_signatures(implementation, dispatcher)
@functools.wraps(implement... | https://github.com/numpy/numpy/issues/12162 | In [1]: import numpy as np
In [2]: class Sub(np.ndarray):
...: def __array_function__(*args, **kwargs):
...: return NotImplemented
...:
In [3]: repr(np.array(1).view(Sub))
---------------------------------------------------------------------------
TypeError Traceback (most ... | TypeError |
def _check_fill_value(fill_value, ndtype):
"""
Private function validating the given `fill_value` for the given dtype.
If fill_value is None, it is set to the default corresponding to the dtype.
If fill_value is not None, its value is forced to the given dtype.
The result is always a 0d array.
... | def _check_fill_value(fill_value, ndtype):
"""
Private function validating the given `fill_value` for the given dtype.
If fill_value is None, it is set to the default corresponding to the dtype.
If fill_value is not None, its value is forced to the given dtype.
The result is always a 0d array.
... | https://github.com/numpy/numpy/issues/12248 | (np.ma.array(['A', 'B', 'C'], fill_value='N') == 'A') | (np.ma.array(['A', 'B', 'C'], fill_value='N') == 'A')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/tom/miniconda3/envs/np1153/lib/python3.6/site-packages/numpy/ma/core.py", line 3016, in __array_finalize__
self._fill_value = ... | ValueError |
def _comparison(self, other, compare):
"""Compare self with other using operator.eq or operator.ne.
When either of the elements is masked, the result is masked as well,
but the underlying boolean data are still set, with self and other
considered equal if both are masked, and unequal otherwise.
Fo... | def _comparison(self, other, compare):
"""Compare self with other using operator.eq or operator.ne.
When either of the elements is masked, the result is masked as well,
but the underlying boolean data are still set, with self and other
considered equal if both are masked, and unequal otherwise.
Fo... | https://github.com/numpy/numpy/issues/12248 | (np.ma.array(['A', 'B', 'C'], fill_value='N') == 'A') | (np.ma.array(['A', 'B', 'C'], fill_value='N') == 'A')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/tom/miniconda3/envs/np1153/lib/python3.6/site-packages/numpy/ma/core.py", line 3016, in __array_finalize__
self._fill_value = ... | ValueError |
def _comparison(self, other, compare):
"""Compare self with other using operator.eq or operator.ne.
When either of the elements is masked, the result is masked as well,
but the underlying boolean data are still set, with self and other
considered equal if both are masked, and unequal otherwise.
Fo... | def _comparison(self, other, compare):
"""Compare self with other using operator.eq or operator.ne.
When either of the elements is masked, the result is masked as well,
but the underlying boolean data are still set, with self and other
considered equal if both are masked, and unequal otherwise.
Fo... | https://github.com/numpy/numpy/issues/12248 | (np.ma.array(['A', 'B', 'C'], fill_value='N') == 'A') | (np.ma.array(['A', 'B', 'C'], fill_value='N') == 'A')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/tom/miniconda3/envs/np1153/lib/python3.6/site-packages/numpy/ma/core.py", line 3016, in __array_finalize__
self._fill_value = ... | ValueError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.