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 get_resource_type(resource_id):
parsed = parse_resource_id(resource_id)
# parse_resource_id returns dictionary with "child_type_#" to represent
# types sequence. "type" stores root type.
child_type_keys = [k for k in parsed.keys() if k.find("child_type_") != -1]
types = [parsed.get(k) for k in s... | def get_resource_type(resource_id):
parsed = parse_resource_id(resource_id)
# parse_resource_id returns dictionary with "child_type_#" to represent
# types sequence. "type" stores root type.
child_type_keys = [k for k in parsed.keys() if k.find("child_type_") != -1]
types = [parsed.get(k) for k in s... | https://github.com/cloud-custodian/cloud-custodian/issues/4937 | ====================================================================== FAILURES =======================================================================
________________________________________________________ ActionsMarkForOpTest.test_mark_for_op ________________________________________________________
[gw4] darwin -- ... | AssertionError |
def get_sts_client(session, region):
"""Get the AWS STS endpoint specific for the given region.
Returns the global endpoint if region is not specified.
For the list of regional endpoints, see https://amzn.to/2ohJgtR
"""
if region and USE_STS_REGIONAL:
endpoint_url = "https://sts.{}.amazona... | def get_sts_client(session, region):
"""Get the AWS STS endpoint specific for the given region.
Returns the global endpoint if region is not specified.
For the list of regional endpoints, see https://amzn.to/2ohJgtR
"""
if region and not USE_STS_GLOBAL:
endpoint_url = "https://sts.{}.amazo... | https://github.com/cloud-custodian/cloud-custodian/issues/5023 | 2019-10-31 22:12:24,498: custodian.commands:DEBUG Loaded file policy.yml
Traceback (most recent call last):
File "/usr/local/bin/custodian", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/c7n/cli.py", line 374, in main
command(config)
File "/usr/local/lib/python3.7/site-packages/c7n/c... | botocore.exceptions.NoRegionError |
def load_resource(self, item):
resource = super(ConfigS3, self).load_resource(item)
cfg = item["supplementaryConfiguration"]
# aka standard
if "awsRegion" in item and item["awsRegion"] != "us-east-1":
resource["Location"] = {"LocationConstraint": item["awsRegion"]}
else:
resource["Lo... | def load_resource(self, item):
resource = super(ConfigS3, self).load_resource(item)
cfg = item["supplementaryConfiguration"]
# aka standard
if "awsRegion" in item and item["awsRegion"] != "us-east-1":
resource["Location"] = {"LocationConstraint": item["awsRegion"]}
# owner is under acl per ... | https://github.com/cloud-custodian/cloud-custodian/issues/4885 | [ERROR] AttributeError: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/var/task/custodian_policy.py", line 4, in run
return handler.dispatch_event(event, context)
File "/var/task/c7n/handler.py", line 168, in dispatch_event
p.push(event, context)
File "/var/task/c7n/policy.py", line ... | AttributeError |
def initialize_policies(self, policy_collection, options):
"""Return a set of policies targetted to the given regions.
Supports symbolic regions like 'all'. This will automatically
filter out policies if their being targetted to a region that
does not support the service. Global services will target a
... | def initialize_policies(self, policy_collection, options):
"""Return a set of policies targetted to the given regions.
Supports symbolic regions like 'all'. This will automatically
filter out policies if their being targetted to a region that
does not support the service. Global services will target a
... | https://github.com/cloud-custodian/cloud-custodian/issues/4290 | $ python --version
Python 3.7.3
$ pip --version
pip 19.1.1 from /home/ec2-user/custodian/lib/python3.7/site-packages/pip (python 3.7)
$ pip list|grep c7n
c7n 0.8.44.2
c7n-org 0.5.3
$ custodian run -s ~/output -r all list-ec2-instances.yaml --cache-period 0
2019-06-29 02:53:26,186: custodia... | botocore.exceptions.ClientError |
def add(self, func):
rule = self.get(func.name)
params = self.get_rule_params(func)
if rule and self.delta(rule, params):
log.debug("Updating config rule for %s" % self)
rule.update(params)
return LambdaRetry(self.client.put_config_rule, ConfigRule=rule)
elif rule:
log.d... | def add(self, func):
rule = self.get(func.name)
params = self.get_rule_params(func)
if rule and self.delta(rule, params):
log.debug("Updating config rule for %s" % self)
rule.update(params)
return self.client.put_config_rule(ConfigRule=rule)
elif rule:
log.debug("Config ... | https://github.com/cloud-custodian/cloud-custodian/issues/4559 | 2019-08-08 16:03:56,496: custodian.policy:INFO Provisioning policy lambda cross-account-rds-snapshot
2019-08-08 16:03:58,918: custodian.policy:INFO Provisioning policy lambda cross-account-lambda
2019-08-08 16:04:02,008: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/Libra... | InsufficientPermissionsException |
def get_resources(self, rids, cache=True):
# Launch template versions have a compound primary key
#
# Support one of four forms of resource ids:
#
# - array of launch template ids
# - array of tuples (launch template id, version id)
# - array of dicts (with LaunchTemplateId and VersionNum... | def get_resources(self, rids, cache=True):
# Launch template versions have a compound primary key
#
# Support one of four forms of resource ids:
#
# - array of launch template ids
# - array of tuples (launch template id, version id)
# - array of dicts (with LaunchTemplateId and VersionNum... | https://github.com/cloud-custodian/cloud-custodian/issues/4568 | 2019-08-11 07:22:23,823: custodian.commands:ERROR Error while executing policy remove-outdated-amis, continuing
Traceback (most recent call last):
File "/Users/user/.local/share/virtualenvs/cloudcustodian-ymoVWLAP/lib/python2.7/site-packages/c7n/commands.py", line 269, in run
policy()
File "/Users/user/.local/share/vir... | ClientError |
def send_to_azure_queue(self, queue_uri, message, session):
try:
queue_service, queue_name = StorageUtilities.get_queue_client_by_uri(
queue_uri, session
)
return StorageUtilities.put_queue_message(
queue_service, queue_name, self.pack(message)
).id
except... | def send_to_azure_queue(self, queue_uri, message, session):
queue_service, queue_name = StorageUtilities.get_queue_client_by_uri(
queue_uri, session
)
return StorageUtilities.put_queue_message(
queue_service, queue_name, self.pack(message)
).id
| https://github.com/cloud-custodian/cloud-custodian/issues/4341 | (cloud-custodian) ➜ cloud-custodian git:(master) ✗ custodian-cask run -s=. policies/policy.yml
Custodian Cask (cloudcustodian/c7n:latest)
Skipped image pull - Last checked 23 minutes ago.
2019-07-08 20:57:46,374: custodian.azure.session:INFO Creating session with Azure CLI Authentication
2019-07-08 20:57:46,374: cust... | msrestazure.azure_exceptions.CloudError |
def upload(self):
for root, dirs, files in os.walk(self.root_dir):
for f in files:
blob_name = self.join(self.file_prefix, root[len(self.root_dir) :], f)
blob_name.strip("/")
try:
self.blob_service.create_blob_from_path(
self.container,... | def upload(self):
for root, dirs, files in os.walk(self.root_dir):
for f in files:
blob_name = self.join(self.file_prefix, root[len(self.root_dir) :], f)
blob_name.strip("/")
try:
self.blob_service.create_blob_from_path(
self.container,... | https://github.com/cloud-custodian/cloud-custodian/issues/4341 | (cloud-custodian) ➜ cloud-custodian git:(master) ✗ custodian-cask run -s=. policies/policy.yml
Custodian Cask (cloudcustodian/c7n:latest)
Skipped image pull - Last checked 23 minutes ago.
2019-07-08 20:57:46,374: custodian.azure.session:INFO Creating session with Azure CLI Authentication
2019-07-08 20:57:46,374: cust... | msrestazure.azure_exceptions.CloudError |
def get_finding(self, resources, existing_finding_id, created_at, updated_at):
policy = self.manager.ctx.policy
model = self.manager.resource_type
region = self.data.get("region", self.manager.config.region)
if existing_finding_id:
finding_id = existing_finding_id
else:
finding_id =... | def get_finding(self, resources, existing_finding_id, created_at, updated_at):
policy = self.manager.ctx.policy
model = self.manager.resource_type
if existing_finding_id:
finding_id = existing_finding_id
else:
finding_id = "{}/{}/{}/{}".format(
self.manager.config.region,
... | https://github.com/cloud-custodian/cloud-custodian/issues/3975 | botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the BatchImportFindings operation: User: arn:aws:sts::<account>:assumed-role/CloudCustodianAdminRole/CloudCustodian is not authorized to perform: securityhub:BatchImportFindings
[ERROR] 2019-05-08T08:46:16.357Z error dur... | botocore.error |
def dispatch_event(event, context):
error = event.get("detail", {}).get("errorCode")
if error and C7N_SKIP_EVTERR:
log.debug("Skipping failed operation: %s" % error)
return
if C7N_DEBUG_EVENT:
event["debug"] = True
log.info("Processing event\n %s", format_event(event))
... | def dispatch_event(event, context):
error = event.get("detail", {}).get("errorCode")
if error and C7N_SKIP_EVTERR:
log.debug("Skipping failed operation: %s" % error)
return
if C7N_DEBUG_EVENT:
event["debug"] = True
log.info("Processing event\n %s", format_event(event))
... | https://github.com/cloud-custodian/cloud-custodian/issues/3022 | START RequestId: bd7b329c-d677-11e8-8925-01840da49e11 Version: $LATEST
[INFO] 2018-10-23T03:57:20.426Z bd7b329c-d677-11e8-8925-01840da49e11 Processing event
{
"account": "[sanitized]",
"region": "us-east-1",
"detail": {},
"detail-type": "Scheduled Event",
"source": "aws.events",
"version": "0",
"time": "2018-10-23T03:5... | AttributeError |
def register_resource(klass, registry, event):
for rtype, resource_manager in registry.items():
if not resource_manager.has_arn():
continue
if "post-finding" in resource_manager.action_registry:
continue
resource_manager.action_registry.register("post-finding", klass)... | def register_resource(klass, registry, event):
for rtype, resource_manager in registry.items():
if "post-finding" in resource_manager.action_registry:
continue
resource_manager.action_registry.register("post-finding", klass)
| https://github.com/cloud-custodian/cloud-custodian/issues/3388 | 2019-01-18 02:34:48,434: custodian.policy:INFO policy: support-tag-compliance-import-findings resource:aws.support-case region:us-east-1 count:2 time:0.47
2019-01-18 02:34:48,440: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/home/ec2-user/environment/cloud-custodian/.tox... | AttributeError |
def register_resources(klass, registry, resource_class):
"""meta model subscriber on resource registration.
SecurityHub Findings Filter
"""
for rtype, resource_manager in registry.items():
if not resource_manager.has_arn():
continue
if "post-finding" in resource_manager.acti... | def register_resources(klass, registry, resource_class):
"""meta model subscriber on resource registration.
SecurityHub Findings Filter
"""
for rtype, resource_manager in registry.items():
if "post-finding" in resource_manager.action_registry:
continue
resource_class.filter_... | https://github.com/cloud-custodian/cloud-custodian/issues/3388 | 2019-01-18 02:34:48,434: custodian.policy:INFO policy: support-tag-compliance-import-findings resource:aws.support-case region:us-east-1 count:2 time:0.47
2019-01-18 02:34:48,440: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/home/ec2-user/environment/cloud-custodian/.tox... | AttributeError |
def get_arns(self, resources):
arns = []
m = self.get_model()
arn_key = getattr(m, "arn", None)
if arn_key is False:
raise ValueError("%s do not have arns" % self.type)
id_key = m.id
for r in resources:
_id = r[id_key]
if arn_key:
arns.append(r[arn_key])
... | def get_arns(self, resources):
arns = []
m = self.get_model()
arn_key = getattr(m, "arn", None)
id_key = m.id
for r in resources:
_id = r[id_key]
if arn_key:
arns.append(r[arn_key])
elif "arn" in _id[:3]:
arns.append(_id)
else:
ar... | https://github.com/cloud-custodian/cloud-custodian/issues/3388 | 2019-01-18 02:34:48,434: custodian.policy:INFO policy: support-tag-compliance-import-findings resource:aws.support-case region:us-east-1 count:2 time:0.47
2019-01-18 02:34:48,440: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/home/ec2-user/environment/cloud-custodian/.tox... | AttributeError |
def process_attached(self, client, associated_addrs):
for aa in list(associated_addrs):
try:
client.disassociate_address(AssociationId=aa["AssociationId"])
except ClientError as e:
# If its already been diassociated ignore, else raise.
if not (
e.r... | def process_attached(self, client, associated_addrs):
for aa in list(associated_addrs):
try:
client.disassociate_address(AssociationId=aa["AssociationId"])
except BotoClientError as e:
# If its already been diassociated ignore, else raise.
if not (
... | https://github.com/cloud-custodian/cloud-custodian/issues/3388 | 2019-01-18 02:34:48,434: custodian.policy:INFO policy: support-tag-compliance-import-findings resource:aws.support-case region:us-east-1 count:2 time:0.47
2019-01-18 02:34:48,440: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/home/ec2-user/environment/cloud-custodian/.tox... | AttributeError |
def process(self, network_addrs):
client = local_session(self.manager.session_factory).client("ec2")
force = self.data.get("force")
assoc_addrs = [addr for addr in network_addrs if "AssociationId" in addr]
unassoc_addrs = [addr for addr in network_addrs if "AssociationId" not in addr]
if len(assoc_... | def process(self, network_addrs):
client = local_session(self.manager.session_factory).client("ec2")
force = self.data.get("force")
assoc_addrs = [addr for addr in network_addrs if "AssociationId" in addr]
unassoc_addrs = [addr for addr in network_addrs if "AssociationId" not in addr]
if len(assoc_... | https://github.com/cloud-custodian/cloud-custodian/issues/3388 | 2019-01-18 02:34:48,434: custodian.policy:INFO policy: support-tag-compliance-import-findings resource:aws.support-case region:us-east-1 count:2 time:0.47
2019-01-18 02:34:48,440: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/home/ec2-user/environment/cloud-custodian/.tox... | AttributeError |
def metrics_cmd(options, policies):
log.warning("metrics command is deprecated, and will be removed in future")
policies = [p for p in policies if p.provider_name == "aws"]
start, end = _metrics_get_endpoints(options)
data = {}
for p in policies:
log.info("Getting %s metrics", p)
dat... | def metrics_cmd(options, policies):
start, end = _metrics_get_endpoints(options)
data = {}
for p in policies:
log.info("Getting %s metrics", p)
data[p.name] = p.get_metrics(start, end, options.period)
print(dumps(data, indent=2))
| https://github.com/cloud-custodian/cloud-custodian/issues/3555 | (cloud-custodian) $ custodian metrics policies/policy.yml
2019-02-20 11:19:18,346: custodian.azure.session:INFO Creating session with Azure CLI Authentication
2019-02-20 11:19:18,347: custodian.azure.session:INFO Session using Subscription ID: <my sub redacted>
2019-02-20 11:19:18,347: custodian.commands:INFO Getting <... | ValueError |
def initialize(self, options):
""" """
_default_region(options)
_default_account_id(options)
if options.tracer and options.tracer.startswith("xray") and HAVE_XRAY:
XrayTracer.initialize()
return options
| def initialize(self, options):
""" """
_default_region(options)
_default_account_id(options)
if options.tracer:
XrayTracer.initialize()
return options
| https://github.com/cloud-custodian/cloud-custodian/issues/3301 | $ pip list|grep c7n
c7n 0.8.33.0
c7n-org 0.5.0
$ cat list-ec2-instances.yaml
policies:
- name: list-ec2-instances
resource: ec2
$ custodian run -s ~/output -r us-east-1 list-ec2-instances.yaml
2019-01-03 22:20:42,075: custodian.policy:INFO policy: list-ec2-instances resource:ec2 region:us-... | NameError |
def process(self, resources, events=None):
if self.manager:
sweeper = AnnotationSweeper(self.manager.get_model().id, resources)
for f in self.filters:
resources = f.process(resources, events)
if not resources:
break
if self.manager:
sweeper.sweep(resources)
... | def process(self, resources, events=None):
if self.manager:
sweeper = AnnotationSweeper(self.manager.get_model().id, resources)
for f in self.filters:
resources = f.process(resources, events)
if self.manager:
sweeper.sweep(resources)
return resources
| https://github.com/cloud-custodian/cloud-custodian/issues/3052 | Traceback (most recent call last):
File "/cloud-custodian/c7n/policy.py", line 241, in run
resources = self.policy.resource_manager.resources()
File "/cloud-custodian/c7n/resources/account.py", line 71, in resources
return self.filter_resources([get_account(self.session_factory, self.config)])
File "/cloud-custodian/c7... | IndexError |
def process_set(self, resources, event):
resource_type = self.manager.get_model()
resource_map = {r[resource_type.id]: r for r in resources}
sweeper = AnnotationSweeper(resource_type.id, resources)
for f in self.filters:
resources = f.process(resources, event)
if not resources:
... | def process_set(self, resources, event):
resource_type = self.manager.get_model()
resource_map = {r[resource_type.id]: r for r in resources}
sweeper = AnnotationSweeper(resource_type.id, resources)
for f in self.filters:
resources = f.process(resources, event)
before = set(resource_map.key... | https://github.com/cloud-custodian/cloud-custodian/issues/3052 | Traceback (most recent call last):
File "/cloud-custodian/c7n/policy.py", line 241, in run
resources = self.policy.resource_manager.resources()
File "/cloud-custodian/c7n/resources/account.py", line 71, in resources
return self.filter_resources([get_account(self.session_factory, self.config)])
File "/cloud-custodian/c7... | IndexError |
def process(self, resources, event=None):
client = local_session(self.manager.session_factory).client("logs")
accounts = self.get_accounts()
results = []
with self.executor_factory(max_workers=1) as w:
futures = []
for rset in chunks(resources, 50):
futures.append(w.submit(se... | def process(self, resources, event=None):
client = local_session(self.manager.session_factory).client("logs")
accounts = self.get_accounts()
results = []
with self.executor_factory(max_workers=2) as w:
futures = []
for rset in chunks(resources, 50):
futures.append(w.submit(se... | https://github.com/cloud-custodian/cloud-custodian/issues/2939 | type object 'resource_type' has no attribute 'filter_type': AttributeError
Traceback (most recent call last):
File "/var/task/custodian_policy.py", line 4, in run
return handler.dispatch_event(event, context)
File "/var/task/c7n/handler.py", line 91, in dispatch_event
p.push(event, context)
File "/var/task/c7n/policy.p... | AttributeError |
def get_snapshots(self, ec2, snap_ids):
"""get snapshots corresponding to id, but tolerant of invalid id's."""
while snap_ids:
try:
result = ec2.describe_snapshots(SnapshotIds=snap_ids)
except ClientError as e:
bad_snap = NotEncryptedFilter.get_bad_snapshot(e)
... | def get_snapshots(self, ec2, snap_ids):
"""get snapshots corresponding to id, but tolerant of invalid id's."""
while True:
try:
result = ec2.describe_snapshots(SnapshotIds=snap_ids)
except ClientError as e:
bad_snap = NotEncryptedFilter.get_bad_snapshot(e)
if ... | https://github.com/cloud-custodian/cloud-custodian/issues/2467 | 'snap-xxxxxxxx': KeyError
Traceback (most recent call last):
File "/var/task/custodian_policy.py", line 4, in run
return handler.dispatch_event(event, context)
File "/var/task/c7n/handler.py", line 89, in dispatch_event
p.push(event, context)
File "/var/task/c7n/policy.py", line 739, in push
return mode.run(event, lamb... | KeyError |
def main():
parser = setup_parser()
argcomplete.autocomplete(parser)
options = parser.parse_args()
if options.subparser is None:
parser.print_help(file=sys.stderr)
return sys.exit(2)
_setup_logger(options)
# Support the deprecated -c option
if getattr(options, "config", Non... | def main():
parser = setup_parser()
argcomplete.autocomplete(parser)
options = parser.parse_args()
_setup_logger(options)
# Support the deprecated -c option
if getattr(options, "config", None) is not None:
options.configs.append(options.config)
config = Config.empty(**vars(options... | https://github.com/cloud-custodian/cloud-custodian/issues/2332 | $ custodian
Traceback (most recent call last):
File "/Users/kapil/projects/cloud-custodian/bin/custodian", line 11, in <module>
load_entry_point('c7n', 'console_scripts', 'custodian')()
File "/Users/kapil/projects/cloud-custodian/c7n/cli.py", line 335, in main
_setup_logger(options)
File "/Users/kapil/projects/cloud-cu... | AttributeError |
def add_directory(self, path):
"""Add ``*.py`` files under the directory ``path`` to the archive."""
for root, dirs, files in os.walk(path):
arc_prefix = os.path.relpath(root, os.path.dirname(path))
for f in files:
if f.endswith(".pyc") or f.endswith(".c"):
continue
... | def add_directory(self, path):
"""Add ``*.py`` files under the directory ``path`` to the archive."""
for root, dirs, files in os.walk(path):
arc_prefix = os.path.relpath(root, os.path.dirname(path))
for f in files:
if not f.endswith(".py"):
continue
f_path... | https://github.com/cloud-custodian/cloud-custodian/issues/2332 | $ custodian
Traceback (most recent call last):
File "/Users/kapil/projects/cloud-custodian/bin/custodian", line 11, in <module>
load_entry_point('c7n', 'console_scripts', 'custodian')()
File "/Users/kapil/projects/cloud-custodian/c7n/cli.py", line 335, in main
_setup_logger(options)
File "/Users/kapil/projects/cloud-cu... | AttributeError |
def __init__(self, ctx):
super(DirectoryOutput, self).__init__(ctx)
if self.root_dir.startswith("file://"):
self.root_dir = self.root_dir[len("file://") :]
if self.ctx.output_path is not None:
if not os.path.exists(self.root_dir):
os.makedirs(self.root_dir)
| def __init__(self, ctx):
super(DirectoryOutput, self).__init__(ctx)
if self.root_dir.startswith("file://"):
self.root_dir = self.root_dir[len("file://") :]
if self.ctx.output_path is not None:
if not os.path.exists(self.ctx.output_path):
os.makedirs(self.ctx.output_path)
| https://github.com/cloud-custodian/cloud-custodian/issues/2332 | $ custodian
Traceback (most recent call last):
File "/Users/kapil/projects/cloud-custodian/bin/custodian", line 11, in <module>
load_entry_point('c7n', 'console_scripts', 'custodian')()
File "/Users/kapil/projects/cloud-custodian/c7n/cli.py", line 335, in main
_setup_logger(options)
File "/Users/kapil/projects/cloud-cu... | AttributeError |
def get_archive(config):
archive = PythonPackageArchive(
"c7n_mailer",
# core deps
"jinja2",
"markupsafe",
"ruamel",
"ldap3",
"pyasn1",
"redis",
# transport datadog - recursive deps
"datadog",
"simplejson",
"decorator",
... | def get_archive(config):
archive = PythonPackageArchive(
"c7n_mailer",
"ldap3",
"pyasn1",
"jinja2",
"markupsafe",
"ruamel",
"redis",
"datadog",
"slackclient",
"requests",
)
template_dir = os.path.abspath(
os.path.join(o... | https://github.com/cloud-custodian/cloud-custodian/issues/2332 | $ custodian
Traceback (most recent call last):
File "/Users/kapil/projects/cloud-custodian/bin/custodian", line 11, in <module>
load_entry_point('c7n', 'console_scripts', 'custodian')()
File "/Users/kapil/projects/cloud-custodian/c7n/cli.py", line 335, in main
_setup_logger(options)
File "/Users/kapil/projects/cloud-cu... | AttributeError |
def account_tags(account):
tags = {"AccountName": account["name"], "AccountId": account["account_id"]}
for t in account.get("tags", ()):
if ":" not in t:
continue
k, v = t.split(":", 1)
k = "Account%s" % k.capitalize()
tags[k] = v
return tags
| def account_tags(account):
tags = {"AccountName": account["name"], "AccountId": account["account_id"]}
for t in account.get("tags"):
if not ":" in t:
continue
k, v = t.split(":", 1)
k = "Account%s" % k.capitalize()
tags[k] = v
return tags
| https://github.com/cloud-custodian/cloud-custodian/issues/1828 | c7n-org run --debug -c config/accounts.yml -a tscloud -u policies/tscloud/tag-compliance.yml -s /tmp/c7n --region us-west-2
Traceback (most recent call last):
File "/home/cbouscal/.local/bin/c7n-org", line 11, in <module>
sys.exit(cli())
File "/usr/lib/python2.7/site-packages/click/core.py", line 716, in __call__
ret... | TypeError |
def handle_BucketLifecycleConfiguration(self, resource, item_value):
rules = []
for r in item_value.get("rules"):
rr = {}
rules.append(rr)
expiry = {}
for ek, ck in (
("Date", "expirationDate"),
("ExpiredObjectDeleteMarker", "expiredObjectDeleteMarker"),
... | def handle_BucketLifecycleConfiguration(self, resource, item_value):
rules = []
for r in item_value.get("rules"):
rr = {}
rules.append(rr)
expiry = {}
for ek, ck in (
("Date", "expirationDate"),
("ExpiredObjectDeleteMarker", "expiredObjectDeleteMarker"),
... | https://github.com/cloud-custodian/cloud-custodian/issues/1691 | 2017-10-22 11:25:17,078: policyrun:DEBUG Running policy:blahblah account:acct1 region:us-east-1
2017-10-22 11:25:44,412: custodian.resources.s3:ERROR Exception getting resources from config
u'redirectsAllRequestsTo'
2017-10-22 11:25:44,414: custodian.output:ERROR Error while executing policy
Traceback (most recent call... | KeyError |
def handle_BucketWebsiteConfiguration(self, resource, item_value):
website = {}
if item_value["indexDocumentSuffix"]:
website["IndexDocument"] = {"Suffix": item_value["indexDocumentSuffix"]}
if item_value["errorDocument"]:
website["ErrorDocument"] = {"Key": item_value["errorDocument"]}
i... | def handle_BucketWebsiteConfiguration(self, resource, item_value):
website = {}
if item_value["indexDocumentSuffix"]:
website["IndexDocument"] = {"Suffix": item_value["indexDocumentSuffix"]}
if item_value["errorDocument"]:
website["ErrorDocument"] = {"Key": item_value["errorDocument"]}
i... | https://github.com/cloud-custodian/cloud-custodian/issues/1691 | 2017-10-22 11:25:17,078: policyrun:DEBUG Running policy:blahblah account:acct1 region:us-east-1
2017-10-22 11:25:44,412: custodian.resources.s3:ERROR Exception getting resources from config
u'redirectsAllRequestsTo'
2017-10-22 11:25:44,414: custodian.output:ERROR Error while executing policy
Traceback (most recent call... | KeyError |
def camelResource(obj):
"""Some sources from apis return lowerCased where as describe calls
always return TitleCase, this function turns the former to the later
"""
if not isinstance(obj, dict):
return obj
for k in list(obj.keys()):
v = obj.pop(k)
obj["%s%s" % (k[0].upper(),... | def camelResource(obj):
"""Some sources from apis return lowerCased where as describe calls
always return TitleCase, this function turns the former to the later
"""
if not isinstance(obj, dict):
return obj
for k in list(obj.keys()):
v = obj.pop(k)
obj["%s%s" % (k[0].upper(),... | https://github.com/cloud-custodian/cloud-custodian/issues/1221 | argument of type 'NoneType' is not iterable: TypeError
Traceback (most recent call last):
File "/var/task/custodian_policy.py", line 4, in run
return handler.dispatch_event(event, context)
File "/var/task/c7n/handler.py", line 86, in dispatch_event
p.push(event, context)
File "/var/task/c7n/policy.py", line 579, in pus... | TypeError |
def get(self, resource_type, identities):
"""Get resources by identities"""
m = self.resolve(resource_type)
params = {}
client_filter = False
# Try to formulate server side query
if m.filter_name:
if m.filter_type == "list":
params[m.filter_name] = identities
elif m.... | def get(self, resource_type, identities):
"""Get resources by identities"""
m = self.resolve(resource_type)
params = {}
client_filter = False
# Try to formulate server side query
if m.filter_name:
if m.filter_type == "list":
params[m.filter_name] = identities
elif m.... | https://github.com/cloud-custodian/cloud-custodian/issues/1398 | string indices must be integers: TypeError
Traceback (most recent call last):
File "/var/task/custodian_policy.py", line 4, in run
return handler.dispatch_event(event, context)
File "/var/task/c7n/handler.py", line 109, in dispatch_event
p.push(event, context)
File "/var/task/c7n/policy.py", line 650, in push
return mo... | TypeError |
def get_appelb_target_groups(self):
manager = self.manager.get_resource_manager("app-elb-target-group")
return set([a["TargetGroupArn"] for a in manager.resources()])
| def get_appelb_target_groups(self):
manager = self.manager.get_resource_manager("app-elb")
return set([a["TargetGroupArn"] for a in manager.resources()])
| https://github.com/cloud-custodian/cloud-custodian/issues/825 | 2017-01-06 20:10:44,873: custodian.resources.keypair:INFO Filtered from 110 to 110 keypair
2017-01-06 20:10:46,097: custodian.resources.elb:INFO Filtered from 2 to 2 elb
2017-01-06 20:10:47,047: custodian.resources.appelb:INFO Filtered from 1 to 1 appelb
2017-01-06 20:10:47,048: custodian.output:ERROR Error while execu... | KeyError |
def check_cross_account(policy_text, allowed_accounts):
"""Find cross account access policy grant not explicitly allowed"""
if isinstance(policy_text, basestring):
policy = json.loads(policy_text)
else:
policy = policy_text
violations = []
for s in policy["Statement"]:
princ... | def check_cross_account(policy_text, allowed_accounts):
"""Find cross account access policy grant not explicitly allowed"""
if isinstance(policy_text, basestring):
policy = json.loads(policy_text)
else:
policy = policy_text
violations = []
for s in policy["Statement"]:
princ... | https://github.com/cloud-custodian/cloud-custodian/issues/805 | 2016-12-26 00:27:01,755 - ERROR - custodian.output - Error while executing policy
Traceback (most recent call last):
File "/usr/local/custodian/local/lib/python2.7/site-packages/c7n/policy.py", line 167, in run
resources = self.policy.resource_manager.resources()
File "/usr/local/custodian/local/lib/python2.7/site-pack... | KeyError |
def process(self, resources, event=None):
days = self.data.get("days", 14)
duration = timedelta(days)
self.metric = self.data["name"]
self.end = datetime.utcnow()
self.start = self.end - duration
self.period = int(self.data.get("period", duration.total_seconds()))
self.statistics = self.dat... | def process(self, resources, event=None):
days = self.data.get("days", 14)
duration = timedelta(days)
self.metric = self.data["name"]
self.end = datetime.utcnow()
self.start = self.end - duration
self.period = int(self.data.get("period", duration.total_seconds()))
self.statistics = self.dat... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def augment(self, resources):
"""EC2 API and AWOL Tags
While ec2 api generally returns tags when doing describe_x on for
various resources, it may also silently fail to do so unless a tag
is used as a filter.
See footnote on http://goo.gl/YozD9Q for official documentation.
Apriori we may be u... | def augment(self, resources):
"""EC2 API and AWOL Tags
While ec2 api generally returns tags when doing describe_x on for
various resources, it may also silently fail to do so unless a tag
is used as a filter.
See footnote on http://goo.gl/YozD9Q for official documentation.
Apriori we may be u... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def augment(self, resources):
_rds_tags(
self.get_model(),
resources,
self.session_factory,
self.executor_factory,
self.arn_generator,
)
return resources
| def augment(self, resources):
session = local_session(self.session_factory)
if self.account_id is None:
self.account_id = get_account_id(session)
_rds_tags(
self.query.resolve(self.resource_type),
resources,
self.session_factory,
self.executor_factory,
self.ac... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def _rds_tags(model, dbs, session_factory, executor_factory, arn_generator):
"""Augment rds instances with their respective tags."""
def process_tags(db):
client = local_session(session_factory).client("rds")
arn = arn_generator.generate(db[model.id])
tag_list = client.list_tags_for_res... | def _rds_tags(model, dbs, session_factory, executor_factory, account_id, region):
"""Augment rds instances with their respective tags."""
def process_tags(db):
client = local_session(session_factory).client("rds")
arn = "arn:aws:rds:%s:%s:db:%s" % (region, account_id, db[model.id])
tag_... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def process_tags(db):
client = local_session(session_factory).client("rds")
arn = arn_generator.generate(db[model.id])
tag_list = client.list_tags_for_resource(ResourceName=arn)["TagList"]
db["Tags"] = tag_list or []
return db
| def process_tags(db):
client = local_session(session_factory).client("rds")
arn = "arn:aws:rds:%s:%s:db:%s" % (region, account_id, db[model.id])
tag_list = client.list_tags_for_resource(ResourceName=arn)["TagList"]
db["Tags"] = tag_list or []
return db
| https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def process_resource_set(self, resources, tags):
client = local_session(self.manager.session_factory).client("rds")
for r in resources:
arn = self.manager.arn_generator.generate(r["DBInstanceIdentifier"])
client.add_tags_to_resource(ResourceName=arn, Tags=tags)
| def process_resource_set(self, resources, tags):
client = local_session(self.manager.session_factory).client("rds")
for r in resources:
arn = "arn:aws:rds:%s:%s:db:%s" % (
self.manager.config.region,
self.manager.account_id,
r["DBInstanceIdentifier"],
)
... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def process_resource_set(self, resources, tags):
client = local_session(self.manager.session_factory).client("rds")
for r in resources:
arn = self.manager.arn_generator.generate(r["DBInstanceIdentifier"])
client.add_tags_to_resource(ResourceName=arn, Tags=tags)
| def process_resource_set(self, resources, tags):
client = local_session(self.manager.session_factory).client("rds")
for r in resources:
arn = "arn:aws:rds:%s:%s:db:%s" % (
self.manager.config.region,
self.manager.account_id,
r["DBInstanceIdentifier"],
)
... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def process_resource_set(self, resources, tag_keys):
client = local_session(self.manager.session_factory).client("rds")
for r in resources:
arn = self.manager.arn_generator.generate(r["DBInstanceIdentifier"])
client.remove_tags_from_resource(ResourceName=arn, TagKeys=tag_keys)
| def process_resource_set(self, resources, tag_keys):
client = local_session(self.manager.session_factory).client("rds")
for r in resources:
arn = "arn:aws:rds:%s:%s:db:%s" % (
self.manager.config.region,
self.manager.account_id,
r["DBInstanceIdentifier"],
)
... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def register_tags(filters, actions):
filters.register("marked-for-op", TagActionFilter)
filters.register("tag-count", TagCountFilter)
actions.register("mark-for-op", TagDelayedAction)
actions.register("tag-trim", TagTrim)
actions.register("mark", Tag)
actions.register("tag", Tag)
actions.... | def register_tags(filters, actions, id_key):
filters.register("marked-for-op", TagActionFilter)
filters.register("tag-count", TagCountFilter)
actions.register("mark-for-op", TagDelayedAction.set_id(id_key))
actions.register("tag-trim", TagTrim.set_id(id_key))
tag = Tag.set_id(id_key)
actions.re... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def process(self, resources):
self.id_key = self.manager.get_model().id
self.preserve = set(self.data.get("preserve"))
self.space = self.data.get("space", 3)
with self.executor_factory(max_workers=3) as w:
list(w.map(self.process_resource, resources))
| def process(self, resources):
self.preserve = set(self.data.get("preserve"))
self.space = self.data.get("space", 3)
with self.executor_factory(max_workers=3) as w:
list(w.map(self.process_resource, resources))
| https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def process(self, resources):
self.id_key = self.manager.get_model().id
# Legacy
msg = self.data.get("msg")
msg = self.data.get("value") or msg
tag = self.data.get("tag", DEFAULT_TAG)
tag = self.data.get("key") or tag
# Support setting multiple tags in a single go with a mapping
tags ... | def process(self, resources):
# Legacy
msg = self.data.get("msg")
msg = self.data.get("value") or msg
tag = self.data.get("tag", DEFAULT_TAG)
tag = self.data.get("key") or tag
# Support setting multiple tags in a single go with a mapping
tags = self.data.get("tags")
if tags is None:
... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def process(self, resources):
self.id_key = self.manager.get_model().id
tags = self.data.get("tags", [DEFAULT_TAG])
batch_size = self.data.get("batch_size", self.batch_size)
with self.executor_factory(max_workers=self.concurrency) as w:
futures = []
for resource_set in utils.chunks(res... | def process(self, resources):
tags = self.data.get("tags", [DEFAULT_TAG])
batch_size = self.data.get("batch_size", self.batch_size)
with self.executor_factory(max_workers=self.concurrency) as w:
futures = []
for resource_set in utils.chunks(resources, size=batch_size):
futures.a... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def process(self, resources):
self.id_key = self.manager.get_model().id
# Move this to policy? / no resources bypasses actions?
if not len(resources):
return
msg_tmpl = self.data.get("msg", "Resource does not meet policy: {op}@{action_date}")
op = self.data.get("op", "stop")
tag = sel... | def process(self, resources):
# Move this to policy? / no resources bypasses actions?
if not len(resources):
return
msg_tmpl = self.data.get("msg", "Resource does not meet policy: {op}@{action_date}")
op = self.data.get("op", "stop")
tag = self.data.get("tag", DEFAULT_TAG)
date = self.... | https://github.com/cloud-custodian/cloud-custodian/issues/273 | 2016-07-06 17:38:43,679: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
File "/development/workspace/cloud-custodian/c7n/policy.py", line 213, in poll
results = a.process(resources)
File "/development/workspace/cloud-custodian/c7n/tags.py", line 339, in process
tags, self.id_key,... | NotImplementedError |
def _getEmbedding(self, obj):
parent = obj.parent
if not parent:
# obj is probably dead.
return None
# optimisation: Passing an Offsets position checks nCharacters, which is an extra call we don't need.
info = self._makeRawTextInfo(parent, textInfos.POSITION_FIRST)
if isinstance(info... | def _getEmbedding(self, obj):
# optimisation: Passing an Offsets position checks nCharacters, which is an extra call we don't need.
info = self._makeRawTextInfo(obj.parent, textInfos.POSITION_FIRST)
if isinstance(info, FakeEmbeddingTextInfo):
info._startOffset = obj.indexInParent
info._endOf... | https://github.com/nvaccess/nvda/issues/5454 | ERROR - scriptHandler.executeScript (20:38:17):
error executing script: <bound method Dynamic_EditableTextWithAutoSelectDetectionEditorMozillaIAccessible.script_caret_newLine of <NVDAObjects.Dynamic_EditableTextWithAutoSelectDetectionEditorMozillaIAccessible object at 0x02ABF190>> with gesture u'enter'
Traceback (most ... | AttributeError |
def _getText(self, withFields, formatConfig=None):
fields = []
if self.isCollapsed:
return fields
if withFields:
# Get the initial control fields.
controlStack = []
rootObj = self.obj
obj = self._startObj
ti = self._start
cannotBeStart = False
... | def _getText(self, withFields, formatConfig=None):
fields = []
if self.isCollapsed:
return fields
if withFields:
# Get the initial control fields.
controlStack = []
rootObj = self.obj
obj = self._startObj
ti = self._start
cannotBeStart = False
... | https://github.com/nvaccess/nvda/issues/5454 | ERROR - scriptHandler.executeScript (20:38:17):
error executing script: <bound method Dynamic_EditableTextWithAutoSelectDetectionEditorMozillaIAccessible.script_caret_newLine of <NVDAObjects.Dynamic_EditableTextWithAutoSelectDetectionEditorMozillaIAccessible object at 0x02ABF190>> with gesture u'enter'
Traceback (most ... | AttributeError |
def _getText(self, withFields, formatConfig=None):
fields = []
if self.isCollapsed:
return fields
if withFields:
# Get the initial control fields.
controlStack = []
rootObj = self.obj
obj = self._startObj
ti = self._start
cannotBeStart = False
... | def _getText(self, withFields, formatConfig=None):
fields = []
if self.isCollapsed:
return fields
if withFields:
# Get the initial control fields.
controlStack = []
rootObj = self.obj
obj = self._startObj
ti = self._start
cannotBeStart = False
... | https://github.com/nvaccess/nvda/issues/10619 | ERROR - core.CorePump.run (08:48:53.754) - MainThread (9024):
errors in this core pump cycle
Traceback (most recent call last):
File "core.pyc", line 517, in run
File "braille.pyc", line 2216, in pumpAll
File "braille.pyc", line 1952, in handlePendingCaretUpdate
File "braille.pyc", line 1958, in _doCursorMove
File "bra... | IndexError |
def _getAvailableAddonsFromPath(path):
"""Gets available add-ons from path.
An addon is only considered available if the manifest file is loaded with no errors.
@param path: path from where to find addon directories.
@type path: string
@rtype generator of Addon instances
"""
log.debug("Listi... | def _getAvailableAddonsFromPath(path):
"""Gets available add-ons from path.
An addon is only considered available if the manifest file is loaded with no errors.
@param path: path from where to find addon directories.
@type path: string
@rtype generator of Addon instances
"""
log.debug("Listi... | https://github.com/nvaccess/nvda/issues/7686 | INFO - __main__ (13:35:20.844):
Starting NVDA
INFO - core.main (13:35:21.078):
Config dir: C:\Users\Username\AppData\Roaming\nvda
INFO - config.ConfigManager._loadConfig (13:35:21.078):
Loading config: C:\Users\Username\AppData\Roaming\nvda\nvda.ini
INFO - core.main (13:35:21.128):
NVDA version next-14528,b476430a
INFO... | IOError |
def _getFormatFieldAndOffsets(self, offset, formatConfig, calculateOffsets=True):
formatField = textInfos.FormatField()
versionMajor = int(self.obj.excelCellObject.Application.Version.split(".")[0])
if versionMajor >= excel2010VersionMajor:
# displayFormat includes conditional formatting calculated ... | def _getFormatFieldAndOffsets(self, offset, formatConfig, calculateOffsets=True):
formatField = textInfos.FormatField()
if self.obj.excelCellObject.Application.Version > "12.0":
cellObj = self.obj.excelCellObject.DisplayFormat
else:
cellObj = self.obj.excelCellObject
fontObj = cellObj.fo... | https://github.com/nvaccess/nvda/issues/7243 | ERROR - eventHandler.executeEvent (09:03:43):
error executing event: gainFocus on <NVDAObjects.window.excel.ExcelCell object at 0x04F92BB0> with extra args of {}
Traceback (most recent call last):
File "eventHandler.pyo", line 143, in executeEvent
File "eventHandler.pyo", line 91, in __init__
File "eventHandler.pyo", l... | COMError |
def __init__(self, dispatcher):
"""
Args:
dispatcher (:class:`telegram.ext.Dispatcher`):
"""
if not dispatcher.use_context:
raise ValueError(
"CallbackContext should not be used with a non context aware dispatcher!"
)
self._dispatcher = dispatcher
self._bot_da... | def __init__(self, dispatcher):
"""
Args:
dispatcher (:class:`telegram.ext.Dispatcher`):
"""
if not dispatcher.use_context:
raise ValueError(
"CallbackContext should not be used with a non context aware dispatcher!"
)
self._dispatcher = dispatcher
self._bot_da... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def from_error(cls, update, error, dispatcher, async_args=None, async_kwargs=None):
self = cls.from_update(update, dispatcher)
self.error = error
self.async_args = async_args
self.async_kwargs = async_kwargs
return self
| def from_error(cls, update, error, dispatcher):
self = cls.from_update(update, dispatcher)
self.error = error
return self
| https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
callback,
pass_update_queue=False,
pass_job_queue=False,
pattern=None,
pass_groups=False,
pass_groupdict=False,
pass_user_data=False,
pass_chat_data=False,
run_async=False,
):
super().__init__(
callback,
pass_update_queue=pass_update_queue,... | def __init__(
self,
callback,
pass_update_queue=False,
pass_job_queue=False,
pattern=None,
pass_groups=False,
pass_groupdict=False,
pass_user_data=False,
pass_chat_data=False,
):
super().__init__(
callback,
pass_update_queue=pass_update_queue,
pass_job_que... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
command,
callback,
filters=None,
allow_edited=None,
pass_args=False,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
run_async=False,
):
super().__init__(
callback,
pass_update_queue=pass_updat... | def __init__(
self,
command,
callback,
filters=None,
allow_edited=None,
pass_args=False,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
):
super().__init__(
callback,
pass_update_queue=pass_update_queue,
pass... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
prefix,
command,
callback,
filters=None,
pass_args=False,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
run_async=False,
):
self._prefix = list()
self._command = list()
self._commands = list()
s... | def __init__(
self,
prefix,
command,
callback,
filters=None,
pass_args=False,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
):
self._prefix = list()
self._command = list()
self._commands = list()
super().__init__(
... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
entry_points,
states,
fallbacks,
allow_reentry=False,
per_chat=True,
per_user=True,
per_message=False,
conversation_timeout=None,
name=None,
persistent=False,
map_to_parent=None,
):
self.run_async = False
self._entry_points = entry_points
... | def __init__(
self,
entry_points,
states,
fallbacks,
allow_reentry=False,
per_chat=True,
per_user=True,
per_message=False,
conversation_timeout=None,
name=None,
persistent=False,
map_to_parent=None,
):
self._entry_points = entry_points
self._states = states
se... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def run_async(self, func, *args, update=None, **kwargs):
"""
Queue a function (with given args/kwargs) to be run asynchronously. Exceptions raised
by the function will be handled by the error handlers registered with
:meth:`add_error_handler`.
Warning:
* If you're using ``@run_async``/:meth... | def run_async(self, func, *args, **kwargs):
"""Queue a function (with given args/kwargs) to be run asynchronously.
Warning:
If you're using @run_async you cannot rely on adding custom attributes to
:class:`telegram.ext.CallbackContext`. See its docs for more info.
Args:
func (:obj:... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def async_func(*args, **kwargs):
warnings.warn(
"The @run_async decorator is deprecated. Use the `run_async` parameter of"
"`Dispatcher.add_handler` or `Dispatcher.run_async` instead.",
TelegramDeprecationWarning,
stacklevel=2,
)
return Dispatcher.get_instance()._run_async(
... | def async_func(*args, **kwargs):
return Dispatcher.get_instance().run_async(func, *args, **kwargs)
| https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
bot,
update_queue,
workers=4,
exception_event=None,
job_queue=None,
persistence=None,
use_context=False,
):
self.bot = bot
self.update_queue = update_queue
self.job_queue = job_queue
self.workers = workers
self.use_context = use_context
if not... | def __init__(
self,
bot,
update_queue,
workers=4,
exception_event=None,
job_queue=None,
persistence=None,
use_context=False,
):
self.bot = bot
self.update_queue = update_queue
self.job_queue = job_queue
self.workers = workers
self.use_context = use_context
if not... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def _pooled(self):
thr_name = current_thread().getName()
while 1:
promise = self.__async_queue.get()
# If unpacking fails, the thread pool is being closed from Updater._join_async_threads
if not isinstance(promise, Promise):
self.logger.debug(
"Closing run_as... | def _pooled(self):
thr_name = current_thread().getName()
while 1:
promise = self.__async_queue.get()
# If unpacking fails, the thread pool is being closed from Updater._join_async_threads
if not isinstance(promise, Promise):
self.logger.debug(
"Closing run_as... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def process_update(self, update):
"""Processes a single update.
Args:
update (:obj:`str` | :class:`telegram.Update` | :class:`telegram.TelegramError`):
The update to process.
"""
# An error happened while polling
if isinstance(update, TelegramError):
try:
s... | def process_update(self, update):
"""Processes a single update.
Args:
update (:obj:`str` | :class:`telegram.Update` | :class:`telegram.TelegramError`):
The update to process.
"""
# An error happened while polling
if isinstance(update, TelegramError):
try:
s... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def add_handler(self, handler, group=DEFAULT_GROUP):
"""Register a handler.
TL;DR: Order and priority counts. 0 or 1 handlers per group will be used. End handling of
update with :class:`telegram.ext.DispatcherHandlerStop`.
A handler must be an instance of a subclass of :class:`telegram.ext.Handler`. A... | def add_handler(self, handler, group=DEFAULT_GROUP):
"""Register a handler.
TL;DR: Order and priority counts. 0 or 1 handlers per group will be used. End handling of
update with :class:`telegram.ext.DispatcherHandlerStop`.
A handler must be an instance of a subclass of :class:`telegram.ext.Handler`. A... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def update_persistence(self, update=None):
"""Update :attr:`user_data`, :attr:`chat_data` and :attr:`bot_data` in :attr:`persistence`.
Args:
update (:class:`telegram.Update`, optional): The update to process. If passed, only the
corresponding ``user_data`` and ``chat_data`` will be updated.
... | def update_persistence(self, update=None):
"""Update :attr:`user_data`, :attr:`chat_data` and :attr:`bot_data` in :attr:`persistence`.
Args:
update (:class:`telegram.Update`, optional): The update to process. If passed, only the
corresponding ``user_data`` and ``chat_data`` will be updated.
... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def add_error_handler(self, callback, run_async=False):
"""Registers an error handler in the Dispatcher. This handler will receive every error
which happens in your bot.
Note:
Attempts to add the same callback multiple times will be ignored.
Warning:
The errors handled within these han... | def add_error_handler(self, callback):
"""Registers an error handler in the Dispatcher. This handler will receive every error
which happens in your bot.
Warning: The errors handled within these handlers won't show up in the logger, so you
need to make sure that you reraise the error.
Args:
... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def remove_error_handler(self, callback):
"""Removes an error handler.
Args:
callback (:obj:`callable`): The error handler to remove.
"""
self.error_handlers.pop(callback, None)
| def remove_error_handler(self, callback):
"""Removes an error handler.
Args:
callback (:obj:`callable`): The error handler to remove.
"""
if callback in self.error_handlers:
self.error_handlers.remove(callback)
| https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def dispatch_error(self, update, error, promise=None):
"""Dispatches an error.
Args:
update (:obj:`str` | :class:`telegram.Update` | None): The update that caused the error
error (:obj:`Exception`): The error that was raised.
promise (:class:`telegram.utils.Promise`, optional): The prom... | def dispatch_error(self, update, error):
"""Dispatches an error.
Args:
update (:obj:`str` | :class:`telegram.Update` | None): The update that caused the error
error (:obj:`Exception`): The error that was raised.
"""
if self.error_handlers:
for callback in self.error_handlers:
... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
callback,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
run_async=False,
):
self.callback = callback
self.pass_update_queue = pass_update_queue
self.pass_job_queue = pass_job_queue
self.pass_user_data = pass_use... | def __init__(
self,
callback,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
):
self.callback = callback
self.pass_update_queue = pass_update_queue
self.pass_job_queue = pass_job_queue
self.pass_user_data = pass_user_data
self.pass_... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def handle_update(self, update, dispatcher, check_result, context=None):
"""
This method is called if it was determined that an update should indeed
be handled by this instance. Calls :attr:`callback` along with its respectful
arguments. To work with the :class:`telegram.ext.ConversationHandler`, this m... | def handle_update(self, update, dispatcher, check_result, context=None):
"""
This method is called if it was determined that an update should indeed
be handled by this instance. Calls :attr:`callback` along with its respectful
arguments. To work with the :class:`telegram.ext.ConversationHandler`, this m... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
filters,
callback,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
message_updates=None,
channel_post_updates=None,
edited_updates=None,
run_async=False,
):
super().__init__(
callback,
pass_upd... | def __init__(
self,
filters,
callback,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
message_updates=None,
channel_post_updates=None,
edited_updates=None,
):
super().__init__(
callback,
pass_update_queue=pass_update... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
pattern,
callback,
pass_groups=False,
pass_groupdict=False,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
allow_edited=False,
message_updates=True,
channel_post_updates=False,
edited_updates=False,
r... | def __init__(
self,
pattern,
callback,
pass_groups=False,
pass_groupdict=False,
pass_update_queue=False,
pass_job_queue=False,
pass_user_data=False,
pass_chat_data=False,
allow_edited=False,
message_updates=True,
channel_post_updates=False,
edited_updates=False,
):
... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
command,
callback,
pass_args=False,
pass_update_queue=False,
pass_job_queue=False,
run_async=False,
):
super().__init__(
callback,
pass_update_queue=pass_update_queue,
pass_job_queue=pass_job_queue,
run_async=run_async,
)
self.c... | def __init__(
self,
command,
callback,
pass_args=False,
pass_update_queue=False,
pass_job_queue=False,
):
super().__init__(
callback, pass_update_queue=pass_update_queue, pass_job_queue=pass_job_queue
)
self.command = command
self.pass_args = pass_args
| https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
pattern,
callback,
pass_groups=False,
pass_groupdict=False,
pass_update_queue=False,
pass_job_queue=False,
run_async=False,
):
super().__init__(
callback,
pass_update_queue=pass_update_queue,
pass_job_queue=pass_job_queue,
run_async... | def __init__(
self,
pattern,
callback,
pass_groups=False,
pass_groupdict=False,
pass_update_queue=False,
pass_job_queue=False,
):
super().__init__(
callback, pass_update_queue=pass_update_queue, pass_job_queue=pass_job_queue
)
if isinstance(pattern, str):
pattern... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(
self,
type,
callback,
strict=False,
pass_update_queue=False,
pass_job_queue=False,
run_async=False,
):
super().__init__(
callback,
pass_update_queue=pass_update_queue,
pass_job_queue=pass_job_queue,
run_async=run_async,
)
self.type = ... | def __init__(
self, type, callback, strict=False, pass_update_queue=False, pass_job_queue=False
):
super().__init__(
callback, pass_update_queue=pass_update_queue, pass_job_queue=pass_job_queue
)
self.type = type
self.strict = strict
| https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def __init__(self, pooled_function, args, kwargs, update=None, error_handling=True):
self.pooled_function = pooled_function
self.args = args
self.kwargs = kwargs
self.update = update
self.error_handling = error_handling
self.done = Event()
self._result = None
self._exception = None
| def __init__(self, pooled_function, args, kwargs):
self.pooled_function = pooled_function
self.args = args
self.kwargs = kwargs
self.done = Event()
self._result = None
self._exception = None
| https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def run(self):
"""Calls the :attr:`pooled_function` callable."""
try:
self._result = self.pooled_function(*self.args, **self.kwargs)
except Exception as exc:
self._exception = exc
finally:
self.done.set()
| def run(self):
"""Calls the :attr:`pooled_function` callable."""
try:
self._result = self.pooled_function(*self.args, **self.kwargs)
except Exception as exc:
logger.exception("An uncaught error was raised while running the promise")
self._exception = exc
finally:
self.... | https://github.com/python-telegram-bot/python-telegram-bot/issues/682 | <project_path>/venv/bin/python <project_path>/issue.py
2017-06-20 23:24:11,743 - __main__ - INFO - /start
2017-06-20 23:24:11,906 - telegram.ext.dispatcher - WARNING - A TelegramError was raised while processing the Update.
2017-06-20 23:24:11,907 - __main__ - ERROR - Boom!
2017-06-20 23:24:11,907 - __main__ - INFO - /... | telegram.error.BadRequest |
def start_polling(
self,
poll_interval=0.0,
timeout=10,
clean=False,
bootstrap_retries=-1,
read_latency=2.0,
allowed_updates=None,
):
"""Starts polling updates from Telegram.
Args:
poll_interval (:obj:`float`, optional): Time to wait between polling updates from
... | def start_polling(
self,
poll_interval=0.0,
timeout=10,
clean=False,
bootstrap_retries=-1,
read_latency=2.0,
allowed_updates=None,
):
"""Starts polling updates from Telegram.
Args:
poll_interval (:obj:`float`, optional): Time to wait between polling updates from
... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1977 | Exception in thread Bot:377489430:updater:
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Program Files\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\.virtualenvs\sandbox... | NotImplementedError |
def start_webhook(
self,
listen="127.0.0.1",
port=80,
url_path="",
cert=None,
key=None,
clean=False,
bootstrap_retries=0,
webhook_url=None,
allowed_updates=None,
force_event_loop=False,
):
"""
Starts a small http server to listen for updates via webhook. If cert
a... | def start_webhook(
self,
listen="127.0.0.1",
port=80,
url_path="",
cert=None,
key=None,
clean=False,
bootstrap_retries=0,
webhook_url=None,
allowed_updates=None,
):
"""
Starts a small http server to listen for updates via webhook. If cert
and key are not provided, the... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1977 | Exception in thread Bot:377489430:updater:
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Program Files\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\.virtualenvs\sandbox... | NotImplementedError |
def _start_polling(
self,
poll_interval,
timeout,
read_latency,
bootstrap_retries,
clean,
allowed_updates,
ready=None,
): # pragma: no cover
# Thread target of thread 'updater'. Runs in background, pulls
# updates from Telegram and inserts them in the update queue of the
# D... | def _start_polling(
self,
poll_interval,
timeout,
read_latency,
bootstrap_retries,
clean,
allowed_updates,
): # pragma: no cover
# Thread target of thread 'updater'. Runs in background, pulls
# updates from Telegram and inserts them in the update queue of the
# Dispatcher.
... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1977 | Exception in thread Bot:377489430:updater:
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Program Files\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\.virtualenvs\sandbox... | NotImplementedError |
def _start_webhook(
self,
listen,
port,
url_path,
cert,
key,
bootstrap_retries,
clean,
webhook_url,
allowed_updates,
ready=None,
force_event_loop=False,
):
self.logger.debug("Updater thread started (webhook)")
use_ssl = cert is not None and key is not None
if ... | def _start_webhook(
self,
listen,
port,
url_path,
cert,
key,
bootstrap_retries,
clean,
webhook_url,
allowed_updates,
):
self.logger.debug("Updater thread started (webhook)")
use_ssl = cert is not None and key is not None
if not url_path.startswith("/"):
url_pa... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1977 | Exception in thread Bot:377489430:updater:
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Program Files\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\.virtualenvs\sandbox... | NotImplementedError |
def serve_forever(self, force_event_loop=False, ready=None):
with self.server_lock:
self.is_running = True
self.logger.debug("Webhook Server started.")
self._ensure_event_loop(force_event_loop=force_event_loop)
self.loop = IOLoop.current()
self.http_server.listen(self.port, a... | def serve_forever(self):
with self.server_lock:
IOLoop().make_current()
self.is_running = True
self.logger.debug("Webhook Server started.")
self.http_server.listen(self.port, address=self.listen)
self.loop = IOLoop.current()
self.loop.start()
self.logger.debug... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1977 | Exception in thread Bot:377489430:updater:
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Program Files\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\.virtualenvs\sandbox... | NotImplementedError |
def __init__(self, application, request, **kwargs):
super().__init__(application, request, **kwargs)
self.logger = logging.getLogger(__name__)
| def __init__(self, application, request, **kwargs):
super().__init__(application, request, **kwargs)
self.logger = logging.getLogger(__name__)
self._init_asyncio_patch()
| https://github.com/python-telegram-bot/python-telegram-bot/issues/1977 | Exception in thread Bot:377489430:updater:
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Program Files\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\.virtualenvs\sandbox... | NotImplementedError |
def __init__(
self,
entry_points,
states,
fallbacks,
allow_reentry=False,
per_chat=True,
per_user=True,
per_message=False,
conversation_timeout=None,
name=None,
persistent=False,
map_to_parent=None,
):
self.entry_points = entry_points
self.states = states
self... | def __init__(
self,
entry_points,
states,
fallbacks,
allow_reentry=False,
per_chat=True,
per_user=True,
per_message=False,
conversation_timeout=None,
name=None,
persistent=False,
map_to_parent=None,
):
self.entry_points = entry_points
self.states = states
self... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1710 | Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/dispatcher.py", line 372, in process_update
handler.handle_update(update, self, check, context)
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/conversationhandler.py", line 343, in handle_update
new_state = handler.h... | AttributeError |
def add_handler(self, handler, group=DEFAULT_GROUP):
"""Register a handler.
TL;DR: Order and priority counts. 0 or 1 handlers per group will be used. End handling of
update with :class:`telegram.ext.DispatcherHandlerStop`.
A handler must be an instance of a subclass of :class:`telegram.ext.Handler`. A... | def add_handler(self, handler, group=DEFAULT_GROUP):
"""Register a handler.
TL;DR: Order and priority counts. 0 or 1 handlers per group will be used. End handling of
update with :class:`telegram.ext.DispatcherHandlerStop`.
A handler must be an instance of a subclass of :class:`telegram.ext.Handler`. A... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1710 | Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/dispatcher.py", line 372, in process_update
handler.handle_update(update, self, check, context)
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/conversationhandler.py", line 343, in handle_update
new_state = handler.h... | AttributeError |
def _trigger_timeout(self, context, job=None):
self.logger.debug("conversation timeout was triggered!")
# Backward compatibility with bots that do not use CallbackContext
if isinstance(context, CallbackContext):
context = context.job.context
else:
context = job.context
del self.tim... | def _trigger_timeout(self, bot, job):
self.logger.debug("conversation timeout was triggered!")
del self.timeout_jobs[job.context.conversation_key]
handlers = self.states.get(self.TIMEOUT, [])
for handler in handlers:
check = handler.check_update(job.context.update)
if check is not None a... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1366 | 2019-03-18 10:33:52,327 - JobQueue - DEBUG - Ticking jobs with t=1552876432.327480
2019-03-18 10:33:52,329 - JobQueue - DEBUG - Peeked at _trigger_timeout with t=1552876432.325519
2019-03-18 10:33:52,331 - JobQueue - DEBUG - Running job _trigger_timeout
2019-03-18 10:33:52,332 - JobQueue - ERROR - An uncaught error was... | TypeError |
def post(self, url, data, timeout=None):
"""Request an URL.
Args:
url (:obj:`str`): The web location we want to retrieve.
data (dict[str, str|int]): A dict of key/value pairs. Note: On py2.7 value is unicode.
timeout (:obj:`int` | :obj:`float`): If this value is specified, use it as the... | def post(self, url, data, timeout=None):
"""Request an URL.
Args:
url (:obj:`str`): The web location we want to retrieve.
data (dict[str, str|int]): A dict of key/value pairs. Note: On py2.7 value is unicode.
timeout (:obj:`int` | :obj:`float`): If this value is specified, use it as the... | https://github.com/python-telegram-bot/python-telegram-bot/issues/1328 | Traceback (most recent call last):
File "/tmp/z10/lib/python3.5/site-packages/telegram/vendor/ptb_urllib3/urllib3/connectionpool.py", line 402, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/tmp/z10/lib/python3.5/site-packages/telegram/vendor/ptb_urllib3/urllib3/connectionpool.py... | telegram.vendor.ptb_urllib3.urllib3.exceptions.ReadTimeoutError |
def shutdown(self):
with self.shutdown_lock:
if not self.is_running:
self.logger.warning("Webhook Server already stopped.")
return
else:
super(WebhookServer, self).shutdown()
self.is_running = False
| def shutdown(self):
with self.shutdown_lock:
if not self.is_running:
self.logger.warn("Webhook Server already stopped.")
return
else:
super(WebhookServer, self).shutdown()
self.is_running = False
| https://github.com/python-telegram-bot/python-telegram-bot/issues/970 | 2018-01-10 03:54:56,480 - telegram.ext.updater - ERROR - unhandled exception
Traceback (most recent call last):
File "/usr/lib/python3.5/socketserver.py", line 313, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.5/socketserver.py", line 341, in process_request
self.finis... | ConnectionResetError |
def __init__(self, file_id, bot, file_size=None, file_path=None, **kwargs):
# Required
self.file_id = str(file_id)
# Optionals
self.file_size = file_size
self.file_path = file_path
self.bot = bot
self._id_attrs = (self.file_id,)
| def __init__(self, file_id, bot, file_size=None, file_path=None, **kwargs):
# Required
self.file_id = str(file_id)
# Optionals
self.file_size = file_size
if file_path:
self.file_path = str(file_path)
self.bot = bot
self._id_attrs = (self.file_id,)
| https://github.com/python-telegram-bot/python-telegram-bot/issues/650 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/telegram/file.py", line 106, in download
self.bot.request.download(url, filename, timeout=timeout)
File "/usr/local/lib/python3.6/site-packages/telegram/utils/request.py", line 284, in download
buf = self... | UnicodeEncodeError |
def download(self, custom_path=None, out=None, timeout=None):
"""
Download this file. By default, the file is saved in the current working directory with its
original filename as reported by Telegram. If a ``custom_path`` is supplied, it will be
saved to that path instead. If ``out`` is defined, the fil... | def download(self, custom_path=None, out=None, timeout=None):
"""
Download this file. By default, the file is saved in the current working directory with its
original filename as reported by Telegram. If a ``custom_path`` is supplied, it will be
saved to that path instead. If ``out`` is defined, the fil... | https://github.com/python-telegram-bot/python-telegram-bot/issues/650 | Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/telegram/file.py", line 106, in download
self.bot.request.download(url, filename, timeout=timeout)
File "/usr/local/lib/python3.6/site-packages/telegram/utils/request.py", line 284, in download
buf = self... | UnicodeEncodeError |
def getUpdates(self, offset=None, limit=100, timeout=0, network_delay=5.0, **kwargs):
"""Use this method to receive incoming updates using long polling.
Args:
offset (Optional[int]):
Identifier of the first update to be returned. Must be greater by one than the highest
among the identifi... | def getUpdates(self, offset=None, limit=100, timeout=0, network_delay=0.2, **kwargs):
"""Use this method to receive incoming updates using long polling.
Args:
offset:
Identifier of the first update to be returned. Must be greater by
one than the highest among the identifiers of previously... | https://github.com/python-telegram-bot/python-telegram-bot/issues/309 | Python 2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
import telegram
bot = telegram.Bot(token='123123:My_token')
print(bot.getMe())
{'username': u'My_bot', 'first_name': u'Flexget', 'last_name': '', 'type': '', 'id': 123123}
updates = bot.g... | NetworkError |
def start_polling(
self,
poll_interval=0.0,
timeout=10,
network_delay=5.0,
clean=False,
bootstrap_retries=0,
):
"""
Starts polling updates from Telegram.
Args:
poll_interval (Optional[float]): Time to wait between polling updates from Telegram in
seconds. Default is ... | def start_polling(
self,
poll_interval=0.0,
timeout=10,
network_delay=2,
clean=False,
bootstrap_retries=0,
):
"""
Starts polling updates from Telegram.
Args:
poll_interval (Optional[float]): Time to wait between polling
updates from Telegram in seconds. Default i... | https://github.com/python-telegram-bot/python-telegram-bot/issues/309 | Python 2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
import telegram
bot = telegram.Bot(token='123123:My_token')
print(bot.getMe())
{'username': u'My_bot', 'first_name': u'Flexget', 'last_name': '', 'type': '', 'id': 123123}
updates = bot.g... | NetworkError |
def start_polling(
self,
poll_interval=0.0,
timeout=10,
network_delay=2,
clean=False,
bootstrap_retries=0,
):
"""
Starts polling updates from Telegram.
Args:
poll_interval (Optional[float]): Time to wait between polling
updates from Telegram in seconds. Default i... | def start_polling(
self,
poll_interval=0.0,
timeout=10,
network_delay=2,
clean=False,
bootstrap_retries=0,
):
"""
Starts polling updates from Telegram.
Args:
poll_interval (Optional[float]): Time to wait between polling
updates from Telegram in seconds. Default i... | https://github.com/python-telegram-bot/python-telegram-bot/issues/275 | Traceback (most recent call last):
File "main.py", line 43, in <module>
main()
File "main.py", line 34, in main
updates = bot.getUpdates()
File "/usr/local/lib/python3.5/site-packages/telegram/bot.py", line 114, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/telegram/bot.... | telegram.error.NetworkError |
def start_webhook(
self,
listen="127.0.0.1",
port=80,
url_path="",
cert=None,
key=None,
clean=False,
bootstrap_retries=0,
webhook_url=None,
):
"""
Starts a small http server to listen for updates via webhook. If cert
and key are not provided, the webhook will be started d... | def start_webhook(
self,
listen="127.0.0.1",
port=80,
url_path="",
cert=None,
key=None,
clean=False,
bootstrap_retries=0,
webhook_url=None,
):
"""
Starts a small http server to listen for updates via webhook. If cert
and key are not provided, the webhook will be started d... | https://github.com/python-telegram-bot/python-telegram-bot/issues/275 | Traceback (most recent call last):
File "main.py", line 43, in <module>
main()
File "main.py", line 34, in main
updates = bot.getUpdates()
File "/usr/local/lib/python3.5/site-packages/telegram/bot.py", line 114, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/telegram/bot.... | telegram.error.NetworkError |
def _start_polling(
self, poll_interval, timeout, network_delay, bootstrap_retries, clean
):
"""
Thread target of thread 'updater'. Runs in background, pulls
updates from Telegram and inserts them in the update queue of the
Dispatcher.
"""
cur_interval = poll_interval
self.logger.debug(... | def _start_polling(self, poll_interval, timeout, network_delay, bootstrap_retries):
"""
Thread target of thread 'updater'. Runs in background, pulls
updates from Telegram and inserts them in the update queue of the
Dispatcher.
"""
cur_interval = poll_interval
self.logger.debug("Updater thre... | https://github.com/python-telegram-bot/python-telegram-bot/issues/275 | Traceback (most recent call last):
File "main.py", line 43, in <module>
main()
File "main.py", line 34, in main
updates = bot.getUpdates()
File "/usr/local/lib/python3.5/site-packages/telegram/bot.py", line 114, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/telegram/bot.... | telegram.error.NetworkError |
def _start_webhook(
self, listen, port, url_path, cert, key, bootstrap_retries, clean, webhook_url
):
self.logger.debug("Updater thread started")
use_ssl = cert is not None and key is not None
if not url_path.startswith("/"):
url_path = "/{0}".format(url_path)
# Create and start server
... | def _start_webhook(
self, listen, port, url_path, cert, key, bootstrap_retries, webhook_url
):
self.logger.debug("Updater thread started")
use_ssl = cert is not None and key is not None
if not url_path.startswith("/"):
url_path = "/{0}".format(url_path)
# Create and start server
self.ht... | https://github.com/python-telegram-bot/python-telegram-bot/issues/275 | Traceback (most recent call last):
File "main.py", line 43, in <module>
main()
File "main.py", line 34, in main
updates = bot.getUpdates()
File "/usr/local/lib/python3.5/site-packages/telegram/bot.py", line 114, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/telegram/bot.... | telegram.error.NetworkError |
def _gen_webhook_url(listen, port, url_path):
return "https://{listen}:{port}{path}".format(
listen=listen, port=port, path=url_path
)
| def _gen_webhook_url(self, listen, port, url_path):
return "https://{listen}:{port}{path}".format(
listen=listen, port=port, path=url_path
)
| https://github.com/python-telegram-bot/python-telegram-bot/issues/275 | Traceback (most recent call last):
File "main.py", line 43, in <module>
main()
File "main.py", line 34, in main
updates = bot.getUpdates()
File "/usr/local/lib/python3.5/site-packages/telegram/bot.py", line 114, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/telegram/bot.... | telegram.error.NetworkError |
def main():
global job_queue
updater = Updater("TOKEN")
job_queue = updater.job_queue
# Get the dispatcher to register handlers
dp = updater.dispatcher
# on different commands - answer in Telegram
dp.addHandler(CommandHandler("start", start))
dp.addHandler(CommandHandler("help", start... | def main():
global job_queue
updater = Updater("TOKEN")
job_queue = updater.job_queue
# Get the dispatcher to register handlers
dp = updater.dispatcher
# on different commands - answer in Telegram
dp.addHandler(CommandHandler("start", start))
dp.addHandler(CommandHandler("help", start... | https://github.com/python-telegram-bot/python-telegram-bot/issues/270 | 2016-04-29 11:38:22,002 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while processing the update
Traceback (most recent call last):
File "build/bdist.linux-i686/egg/telegram/ext/dispatcher.py", line 180, in processUpdate
handler.handleUpdate(update, self)
File "build/bdist.linux-i686/egg/telegram/ex... | TypeError |
def message(bot, update, **kwargs):
"""
Example for an asynchronous handler. It's not guaranteed that replies will
be in order when using @run_async. Also, you have to include **kwargs in
your parameter list.
"""
print(kwargs)
sleep(2) # IO-heavy operation here
bot.sendMessage(update.... | def message(bot, update):
"""
Example for an asynchronous handler. It's not guaranteed that replies will
be in order when using @run_async.
"""
sleep(2) # IO-heavy operation here
bot.sendMessage(update.message.chat_id, text="Echo: %s" % update.message.text)
| https://github.com/python-telegram-bot/python-telegram-bot/issues/123 | Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\threading.py", line 923, in _bootstrap_inner
self.run()
File "C:\Program Files\Python 3.5\lib\threading.py", line 871, in run
self._target(*self._args, **self._kwargs)
File "C:\Program Files\Python 3.5\lib\site-packag... | TypeError |
def run_async(func):
"""
Function decorator that will run the function in a new thread. A function
decorated with this will have to include **kwargs in their parameter list,
which will contain all optional parameters.
Args:
func (function): The function to run in the thread.
Returns:
... | def run_async(func):
"""
Function decorator that will run the function in a new thread.
Args:
func (function): The function to run in the thread.
Returns:
function:
"""
@wraps(func)
def pooled(*args, **kwargs):
"""
A wrapper to run a thread in a thread pool... | https://github.com/python-telegram-bot/python-telegram-bot/issues/123 | Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\threading.py", line 923, in _bootstrap_inner
self.run()
File "C:\Program Files\Python 3.5\lib\threading.py", line 871, in run
self._target(*self._args, **self._kwargs)
File "C:\Program Files\Python 3.5\lib\site-packag... | TypeError |
def pooled(*pargs, **kwargs):
"""
A wrapper to run a thread in a thread pool
"""
global running_async, async_lock
result = func(*pargs, **kwargs)
semaphore.release()
with async_lock:
running_async -= 1
return result
| def pooled(*args, **kwargs):
"""
A wrapper to run a thread in a thread pool
"""
global running_async, async_lock
result = func(*args, **kwargs)
semaphore.release()
with async_lock:
running_async -= 1
return result
| https://github.com/python-telegram-bot/python-telegram-bot/issues/123 | Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\threading.py", line 923, in _bootstrap_inner
self.run()
File "C:\Program Files\Python 3.5\lib\threading.py", line 871, in run
self._target(*self._args, **self._kwargs)
File "C:\Program Files\Python 3.5\lib\site-packag... | TypeError |
def async_func(*pargs, **kwargs):
"""
A wrapper to run a function in a thread
"""
global running_async, async_lock
thread = Thread(target=pooled, args=pargs, kwargs=kwargs)
semaphore.acquire()
with async_lock:
running_async += 1
thread.start()
return thread
| def async_func(*args, **kwargs):
"""
A wrapper to run a function in a thread
"""
global running_async, async_lock
thread = Thread(target=pooled, args=args, kwargs=kwargs)
semaphore.acquire()
with async_lock:
running_async += 1
thread.start()
return thread
| https://github.com/python-telegram-bot/python-telegram-bot/issues/123 | Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Program Files\Python 3.5\lib\threading.py", line 923, in _bootstrap_inner
self.run()
File "C:\Program Files\Python 3.5\lib\threading.py", line 871, in run
self._target(*self._args, **self._kwargs)
File "C:\Program Files\Python 3.5\lib\site-packag... | TypeError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.