profile
viewpoint
Timur Demin tdemin Russia https://tdem.in Student at Ufa State Petroleum Technological University

tdemin/tdemin.github.io 2

A simple home page. Now moved to GitLab.

issue commenttwpayne/chezmoi

Calling gopass from any template prepends Password: to template output

Relevant versions:

  • gopass: v1.10.1
  • chezmoi: v1.8.7
tdemin

comment created time in 10 hours

issue openedtwpayne/chezmoi

Calling gopass from any template prepends Password: to template output

Recent versions of gopass have changed the output format (invoking gopass show secretname now displays Password: <secret> instead of just <secret>, you have to call it as follows: gopass show -o secretname). As of chezmoi v1.8.7, chezmoi inserts the output of gopass show in place of {{ gopass "secretname" }}, which results in having Password: <secret> inserted into the config file.

Reproducing

  1. gopass insert something
  2. Add {{ gopass "something" }} into an existing template.
  3. Enjoy Password: ... in place of where the secret should have been.

created time in 10 hours

starteddaneren2005/Subsonic

started time in 11 days

pull request commentgenjidb/genji

Do not panic on genji version when compiled in GOPATH mode

@tie sure thing, just added a notice on using modules.

tdemin

comment created time in 14 days

push eventtdemin/genji

Timur Demin

commit sha 7848504e1786d976a754c5dc5c2704c4df335815

Recommend installing Genji in module mode

view details

push time in 14 days

pull request commentgenjidb/genji

Do not panic when compiled in GOPATH mode

Related issue: #261

tdemin

comment created time in 16 days

pull request commentgenjidb/genji

Do not panic when compiled in GOPATH mode

I was thinking of returning an additional error code with cli.NewExitError("...", 1), but this would add more visual noise (it's already 2 lines of output, and this would add the 3rd one with an exit code).

tdemin

comment created time in 16 days

PR opened genjidb/genji

Do not panic when compiled in GOPATH mode

The genji version command relies on the versions of modules compiled in as debug info. Those are unavailable when compiling Genji with go get github.com/genjidb/genji/cmd/shell (in GOPATH mode). This makes genji version display a message saying the version is not available if genji has been built with go get.

Sample output:

genji on master [!?] via v1.15.2 > GO111MODULE=off go run github.com/genjidb/genji/cmd/genji version
Using z.Allocator with starting ref: 8005000000000000
version not available in GOPATH mode
+5 -2

0 comment

1 changed file

pr created time in 16 days

push eventtdemin/genji

Timur Demin

commit sha a22fe504aa7f63d7bdf0d1b42d2b771a7e09dbba

Do not panic when compiled in GOPATH mode The genji version command relies on the versions of modules compiled in as debug info. Those are unavailable when compiling Genji with go get. This makes genji version display a message saying the version is not available if genji has been built with go get.

view details

push time in 16 days

fork tdemin/genji

Document-oriented, embedded SQL database, works with Bolt, Badger and memory

https://genji.dev

fork in 16 days

issue commentgenjidb/genji

Panic on genji version

The Git commit I built Genji from is 375ed7aafa0f1d508d14671adb450ac6eb4789dd.

tdemin

comment created time in 16 days

issue openedgenjidb/genji

Panic on genji version

After having run go get -u -v github.com/genjidb/genji/cmd/genji, trying to run genji version results in this output:

~ > genji version
Using z.Allocator with starting ref: c74a000000000000
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x919018]

goroutine 1 [running]:
main.main.func2(0xc00007cb80, 0x1, 0x1)
        /home/tdemin/go/src/github.com/genjidb/genji/cmd/genji/main.go:100 +0x58
github.com/urfave/cli.(*Command).Run(0xc0000f6d80, 0xc00007cac0, 0x0, 0x0)
        /home/tdemin/go/src/github.com/urfave/cli/command.go:163 +0x4ed
github.com/urfave/cli.(*App).RunContext(0xc000001980, 0xb69e00, 0xc0000281f0, 0xc00000e080, 0x2, 0x2, 0x0, 0x0)
        /home/tdemin/go/src/github.com/urfave/cli/app.go:306 +0x81f
github.com/urfave/cli.(*App).Run(...)
        /home/tdemin/go/src/github.com/urfave/cli/app.go:217
main.main()
        /home/tdemin/go/src/github.com/genjidb/genji/cmd/genji/main.go:143 +0x612

created time in 16 days

issue commentgenjidb/genji

SQL driver doesn't support timestamp (time.Time)

Running the latest Genji CLI to convert data to timestamp results in this:

genji> update tasks set ctime = cast(ctime as timestamp);
found timestamp, expected type at line 1, char 40
Darkclainer

comment created time in 17 days

issue commentgenjidb/genji

SQL driver doesn't support timestamp (time.Time)

Can confirm, doesn't work for me either with both Genji 0.7.2 and 0.8.0.

Darkclainer

comment created time in 17 days

GollumEvent

startedanurodhp/Monal

started time in a month

startedyggdrasil-network/yggdrasil-go

started time in a month

startedruffle-rs/ruffle

started time in a month

issue commentSamLangTen/KaraokeShow

No display

@MX10-AC2N are you sure you're using LRC lyrics, and not the ones stored in unsynchronized lyrics tags? The README explicitly states KaraokeShow doesn't support unsynchronized lyrics.

MX10-AC2N

comment created time in 2 months

startedFiloSottile/age

started time in 2 months

startedlextudio/monodevelop.netcoredbg

started time in 2 months

startedRevertron/wyrd

started time in 2 months

startedkondanta/notp

started time in 2 months

issue openedeamodio/vscode-gitlens

Publish GitLens in Open VSX

There's an alternate open source extension marketplace for VSCode, Open VSX.

As Microsoft's extensions marketplace cannot be used by Code-OSS and VSCodium users for legal reasons, it's probably a good idea to make GitLens available to them there.

The process of publishing an extension at Open VSX is outlined here.

created time in 2 months

startedVSCodium/vscodium

started time in 2 months

startededankwan/vagina.js

started time in 2 months

starteddanakt/pshe

started time in 2 months

startedshibumi/iwd

started time in 2 months

issue openedShinjiruApp/Shinjiru

Listen on localhost:42069 instead of *:42069

This application leaves a TCP listener on port 42069 on all network interfaces, as seen by nmap/lsof -P.

image

The callbacks received from AniList appear to only refer to localhost:42069. It's probably feasible to only listen on localhost to prevent possible malicious activity against Shinjiru (though the app appears to close any incoming connections) and prevent 3rd party from knowing that the machine runs Shinjiru.

created time in 2 months

issue openedgenjidb/genji

Support time.Time as a datatype

With genji 0.6.0, the way time.Time is stored appears to be blob. Trying to scan a previously stored time.Time value returns this error (I'm using database/sql):

sql: Scan error on column index 0, name "mtime": unsupported Scan, storing driver.Value type encoding.EncodedDocument into type *time.Time

time.Time is supported by a lot of drivers as a datatype, notably go-sqlite3, pgx, and others (I literally encountered this error while porting my app from SQLite3).

created time in 2 months

issue openedgoogle/yapf

yapf crashes on valid conditional assignment from Python 3.8

  • Python: 3.8.2
  • yapf: 0.30.0

The relevant snippet is

def json(self) -> JSONTask:
        result: JSONTask = {
            "id": self.id,
            "text": self.text,
            "status": self.status,
            "last_mod": self.last_mod_time
        }
        for i in "parent_id", "deadline", "reminder":
            if x := getattr(self , i):
                result[i] = x  # type: ignore
        return result

yapf will crash with this stacktrace:

% yapf
def json(self) -> JSONTask:
        result: JSONTask = {
            "id": self.id,
            "text": self.text,
            "status": self.status,
            "last_mod": self.last_mod_time
        }
        for i in "parent_id", "deadline", "reminder":
            if x := getattr(self, i):
                # gotta love how we suppress mypy in the exact places it
                # is supposed to type check.
                result[i] = x  # type: ignore
        return result
<hit Ctrl+D>
Traceback (most recent call last):
  File "/home/tdemin/.cache/pypoetry/virtualenvs/project-amber-255IN1jW-py3.8/lib/python3.8/site-packages/yapf/yapflib/pytree_utils.py", line 115, in ParseCodeToTree
    tree = parser_driver.parse_string(code, debug=False)
  File "/home/tdemin/.pyenv/versions/3.8.2/lib/python3.8/lib2to3/pgen2/driver.py", line 103, in parse_string
    return self.parse_tokens(tokens, debug)
  File "/home/tdemin/.pyenv/versions/3.8.2/lib/python3.8/lib2to3/pgen2/driver.py", line 71, in parse_tokens
    if p.addtoken(type, value, (prefix, start)):
  File "/home/tdemin/.pyenv/versions/3.8.2/lib/python3.8/lib2to3/pgen2/parse.py", line 162, in addtoken
    raise ParseError("bad input", type, value, context)
lib2to3.pgen2.parse.ParseError: bad input: type=22, value='=', context=('', (9, 18))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tdemin/.cache/pypoetry/virtualenvs/project-amber-255IN1jW-py3.8/bin/yapf", line 10, in <module>
    sys.exit(run_main())
  File "/home/tdemin/.cache/pypoetry/virtualenvs/project-amber-255IN1jW-py3.8/lib/python3.8/site-packages/yapf/__init__.py", line 365, in run_main
    sys.exit(main(sys.argv))
  File "/home/tdemin/.cache/pypoetry/virtualenvs/project-amber-255IN1jW-py3.8/lib/python3.8/site-packages/yapf/__init__.py", line 103, in main
    reformatted_source, _ = yapf_api.FormatCode(
  File "/home/tdemin/.cache/pypoetry/virtualenvs/project-amber-255IN1jW-py3.8/lib/python3.8/site-packages/yapf/yapflib/yapf_api.py", line 147, in FormatCode
    tree = pytree_utils.ParseCodeToTree(unformatted_source)
  File "/home/tdemin/.cache/pypoetry/virtualenvs/project-amber-255IN1jW-py3.8/lib/python3.8/site-packages/yapf/yapflib/pytree_utils.py", line 121, in ParseCodeToTree
    tree = parser_driver.parse_string(code, debug=False)
  File "/home/tdemin/.pyenv/versions/3.8.2/lib/python3.8/lib2to3/pgen2/driver.py", line 103, in parse_string
    return self.parse_tokens(tokens, debug)
  File "/home/tdemin/.pyenv/versions/3.8.2/lib/python3.8/lib2to3/pgen2/driver.py", line 71, in parse_tokens
    if p.addtoken(type, value, (prefix, start)):
  File "/home/tdemin/.pyenv/versions/3.8.2/lib/python3.8/lib2to3/pgen2/parse.py", line 162, in addtoken
    raise ParseError("bad input", type, value, context)
lib2to3.pgen2.parse.ParseError: bad input: type=22, value='=', context=('', (9, 18))

Reworking the part with := into this code:

x = getattr(...)
if x:

works just fine. Probably not relevant, but here's the relevant part of setup.cfg:

[yapf]
based_on_style = pep8
split_before_logical_operator = true
blank_line_before_nested_class_or_def = false
coalesce_brackets = true
dedent_closing_brackets = true
indent_closing_brackets = false
indent_width = 4
use_tabs = false
column_limit = 100

This is reproducible on both the original file and only feeding yapf the snippet above via CLI.

created time in 2 months

startedbadoo/funcmap

started time in 2 months

startedsaber-nyan/ImagePoster4DTF

started time in 3 months

issue commentpython/mypy

mypy crashes with AttributeError

I just noticed that the file I linked uses typing.cast the wrong way (should be cast(dict, d)).

This doesn't influence this error in any way, correcting it and trimming validate() to return True will result in the same error.

tdemin

comment created time in 3 months

issue openedpython/mypy

mypy crashes with AttributeError

mypy v0.782 with Python 3.8 fails at checking this file:

% mypy --show-traceback
project_amber/models.py: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.782
Traceback (most recent call last):
  File "/home/tdemin/.cache/pypoetry/virtualenvs/project-amber-255IN1jW-py3.8/bin/mypy", line 10, in <module>
    sys.exit(console_entry())
  File "mypy/build.py", line 1919, in wrap_context
  File "mypy/semanal_main.py", line 360, in check_type_arguments
  File "mypy/nodes.py", line 294, in accept
  File "mypy/semanal_typeargs.py", line 39, in visit_mypy_file
  File "mypy/traverser.py", line 35, in visit_mypy_file
  File "mypy/nodes.py", line 939, in accept
  File "mypy/semanal_typeargs.py", line 50, in visit_class_def
  File "mypy/mixedtraverser.py", line 28, in visit_class_def
  File "mypy/traverser.py", line 71, in visit_class_def
  File "mypy/nodes.py", line 1004, in accept
  File "mypy/semanal_typeargs.py", line 54, in visit_block
  File "mypy/traverser.py", line 39, in visit_block
  File "mypy/nodes.py", line 766, in accept
  File "mypy/traverser.py", line 76, in visit_decorator
  File "mypy/nodes.py", line 676, in accept
  File "mypy/traverser.py", line 54, in visit_func_def
  File "mypy/semanal_typeargs.py", line 46, in visit_func
  File "mypy/mixedtraverser.py", line 23, in visit_func
  File "mypy/mixedtraverser.py", line 91, in visit_optional_type
  File "mypy/types.py", line 1098, in accept
  File "mypy/typetraverser.py", line 52, in visit_callable_type
  File "mypy/types.py", line 794, in accept
  File "mypy/semanal_typeargs.py", line 70, in visit_instance
AttributeError: attribute 'defn' of 'TypeInfo' undefined
project_amber/models.py: : note: use --pdb to drop into pdb

The output changes when running mypy v0.790 from git master with system Python 3.8.5:

project_amber/models.py: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.790+dev.5e9682143720263466f0aaed1924ccb218160ee0
Traceback (most recent call last):
  File "/usr/bin/mypy", line 33, in <module>
    sys.exit(load_entry_point('mypy==0.790+dev.5e9682143720263466f0aaed1924ccb218160ee0', 'console_scripts', 'mypy')())
  File "/usr/lib/python3.8/site-packages/mypy/__main__.py", line 8, in console_entry
    main(None, sys.stdout, sys.stderr)
  File "/usr/lib/python3.8/site-packages/mypy/main.py", line 89, in main
    res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
  File "/usr/lib/python3.8/site-packages/mypy/build.py", line 180, in build
    result = _build(
  File "/usr/lib/python3.8/site-packages/mypy/build.py", line 252, in _build
    graph = dispatch(sources, manager, stdout)
  File "/usr/lib/python3.8/site-packages/mypy/build.py", line 2628, in dispatch
    process_graph(graph, manager)
  File "/usr/lib/python3.8/site-packages/mypy/build.py", line 2951, in process_graph
    process_stale_scc(graph, scc, manager)
  File "/usr/lib/python3.8/site-packages/mypy/build.py", line 3043, in process_stale_scc
    mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors)
  File "/usr/lib/python3.8/site-packages/mypy/semanal_main.py", line 84, in semantic_analysis_for_scc
    check_type_arguments(graph, scc, errors)
  File "/usr/lib/python3.8/site-packages/mypy/semanal_main.py", line 360, in check_type_arguments
    state.tree.accept(analyzer)
  File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python3.8/site-packages/mypy/build.py", line 1920, in wrap_context
    yield
  File "/usr/lib/python3.8/site-packages/mypy/semanal_main.py", line 360, in check_type_arguments
    state.tree.accept(analyzer)
  File "/usr/lib/python3.8/site-packages/mypy/nodes.py", line 295, in accept
    return visitor.visit_mypy_file(self)
  File "/usr/lib/python3.8/site-packages/mypy/semanal_typeargs.py", line 39, in visit_mypy_file
    super().visit_mypy_file(o)
  File "/usr/lib/python3.8/site-packages/mypy/traverser.py", line 35, in visit_mypy_file
    d.accept(self)
  File "/usr/lib/python3.8/site-packages/mypy/nodes.py", line 940, in accept
    return visitor.visit_class_def(self)
  File "/usr/lib/python3.8/site-packages/mypy/semanal_typeargs.py", line 50, in visit_class_def
    super().visit_class_def(defn)
  File "/usr/lib/python3.8/site-packages/mypy/mixedtraverser.py", line 28, in visit_class_def
    super().visit_class_def(o)
  File "/usr/lib/python3.8/site-packages/mypy/traverser.py", line 71, in visit_class_def
    o.defs.accept(self)
  File "/usr/lib/python3.8/site-packages/mypy/nodes.py", line 1005, in accept
    return visitor.visit_block(self)
  File "/usr/lib/python3.8/site-packages/mypy/semanal_typeargs.py", line 54, in visit_block
    super().visit_block(o)
  File "/usr/lib/python3.8/site-packages/mypy/traverser.py", line 39, in visit_block
    s.accept(self)
  File "/usr/lib/python3.8/site-packages/mypy/nodes.py", line 767, in accept
    return visitor.visit_decorator(self)
  File "/usr/lib/python3.8/site-packages/mypy/traverser.py", line 76, in visit_decorator
    o.func.accept(self)
  File "/usr/lib/python3.8/site-packages/mypy/nodes.py", line 677, in accept
    return visitor.visit_func_def(self)
  File "/usr/lib/python3.8/site-packages/mypy/traverser.py", line 54, in visit_func_def
    self.visit_func(o)
  File "/usr/lib/python3.8/site-packages/mypy/semanal_typeargs.py", line 46, in visit_func
    super().visit_func(defn)
  File "/usr/lib/python3.8/site-packages/mypy/mixedtraverser.py", line 23, in visit_func
    self.visit_optional_type(o.type)
  File "/usr/lib/python3.8/site-packages/mypy/mixedtraverser.py", line 91, in visit_optional_type
    t.accept(self)
  File "/usr/lib/python3.8/site-packages/mypy/types.py", line 1098, in accept
    return visitor.visit_callable_type(self)
  File "/usr/lib/python3.8/site-packages/mypy/typetraverser.py", line 52, in visit_callable_type
    t.fallback.accept(self)
  File "/usr/lib/python3.8/site-packages/mypy/types.py", line 794, in accept
    return visitor.visit_instance(self)
  File "/usr/lib/python3.8/site-packages/mypy/semanal_typeargs.py", line 70, in visit_instance
    for (i, arg), tvar in zip(enumerate(t.args), info.defn.type_vars):
  File "/usr/lib/python3.8/site-packages/mypy/nodes.py", line 2660, in __getattribute__
    raise AssertionError(object.__getattribute__(self, 'msg'))
AssertionError: fallback can't be filled out until semanal

mypy is set up with setup.cfg as follows:

[mypy]
files = project_amber
namespace_packages = true
[mypy-bcrypt.*]
ignore_missing_imports = true
[mypy-flask_sqlalchemy.*]
ignore_missing_imports = true
[mypy-flask_cors.*]
ignore_missing_imports = true

The part that confuses mypy appears to be this class (without type: ignore mypy gives out a typing error Invalid statement in TypedDict definition; expected "field_name: field_type", but doesn't crash):

from typing import TypedDict, Any, cast

class JSONTask(TypedDict, total=False):
    ...
    @staticmethod  # type: ignore
    def validate(d: Any) -> bool:
        ...
        return True

I don't think this is how it should be, as Python works just fine with this code:

image

created time in 3 months

push eventtdemin/public-peers

Timur Demin

commit sha 94d499312952dfa1a0bd1efe7236baa6858de824

Add TLS to Ufa node

view details

push time in 3 months

PR opened yggdrasil-network/public-peers

Add Ufa peer
+3 -0

0 comment

1 changed file

pr created time in 3 months

push eventtdemin/public-peers

Timur Demin

commit sha d3de5a01a22ba4322199d2d5df6d6479c7f26b50

Add Ufa public node

view details

push time in 3 months

fork tdemin/public-peers

Public peers in the Yggdrasil network

fork in 3 months

more