Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pendulum PanicException on FreeBSD 14 #791

Open
kigon001 opened this issue Jan 5, 2024 · 4 comments
Open

pendulum PanicException on FreeBSD 14 #791

kigon001 opened this issue Jan 5, 2024 · 4 comments

Comments

@kigon001
Copy link

kigon001 commented Jan 5, 2024

called `Result::unwrap()` on an `Err` value: PyDowncastError { from: None, to: "PyString" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Exception in thread task_queue:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/task_queue.py", line 46, in run
    self.current_task.execute()
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/task.py", line 87, in wrapper
    return func(self, *args, **kw)
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/task.py", line 722, in execute
    self._execute()
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/task.py", line 691, in _execute
    self.__run_task_phase(phase)
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/task.py", line 514, in __run_task_phase
    response = self.__run_plugin(plugin, phase, args)
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/task.py", line 547, in __run_plugin
    result = method(*args, **kwargs)
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/event.py", line 20, in __call__
    return self.func(*args, **kwargs)
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/plugins/filter/if_condition.py", line 71, in handle_phase
    for entry in passed_entries:
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/plugins/filter/if_condition.py", line 66, in <genexpr>
    passed_entries = (e for e in task.entries if self.check_condition(requirement, e))
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/plugins/filter/if_condition.py", line 43, in check_condition
    passed = evaluate_expression(condition, eval_locals)
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/utils/template.py", line 446, in evaluate_expression
    return compiled_expr(**{**context, **extra_vars()})
  File "/home/share/flexget/lib/python3.9/site-packages/jinja2/environment.py", line 1567, in __call__
    consume(self._template.root_render_func(context))  # type: ignore
  File "/home/share/flexget/lib/python3.9/site-packages/jinja2/utils.py", line 114, in consume
    for _ in iterable:
  File "<template>", line 21, in root
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/utils/template.py", line 114, in __sub__
    return DateTime.__sub__(self, other)
  File "/home/share/flexget/lib/python3.9/site-packages/pendulum/datetime.py", line 1217, in __sub__
    return other.diff(self, False)
  File "/home/share/flexget/lib/python3.9/site-packages/flexget/utils/template.py", line 123, in diff
    return Interval(self, dt, absolute=abs)
  File "/home/share/flexget/lib/python3.9/site-packages/pendulum/interval.py", line 199, in __init__
    self._delta: PreciseDiff = precise_diff(_start, _end)
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: PyDowncastError { from: None, to: "PyString" }```


---------

`
```bin/python3.9 
Python 3.9.18 (main, Nov 12 2023, 02:28:28) 
[Clang 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1 on freebsd14
Type "help", "copyright", "credits" or "license" for more information.
> import pendulum
> >>> pendulum.local_timezone()
> Timezone('None')
> >>> pendulum.now().tz
> Timezone('None')```
@Davidcparrar
Copy link

Davidcparrar commented Jan 16, 2024

This happened to me when changing pendulum version from 2.0 to 3.0 in AWS Lambda (Python 3.10) , I just specified the tz and it worked.

pendulum.now(tz='UTC')

@gazpachoking
Copy link
Contributor

Yeah, it looks like this happens when it tries to default to the local timezone, but the local timezone only has a timezone file without a name.

@kigon001
Copy link
Author

so it happens on more platforms than just freebsd? but should it crash from this?

@kigon001
Copy link
Author

This happened to me when changing pendulum version from 2.0 to 3.0 in AWS Lambda (Python 3.10) , I just specified the tz and it worked.

pendulum.now(tz='UTC')

Flexget is using pendulum, don't think I can specify it like you did there, or can I gazpachoking?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants