IRC logs of #tryton for Monday, 2018-11-12

chat.freenode.net #tryton log beginning Mon Nov 12 00:00:01 CET 2018
-!- csotelo(~csotelo@2800:200:f400:19c:2892:3d67:9264:7ff7) has joined #tryton23:15
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton23:39
-!- thaneor(~lenovo3@179.26.53.92) has joined #tryton00:26
-!- mono2(~mono@181.137.134.104) has joined #tryton00:40
-!- yangoon1(~mathiasb@224-75-142-46.pool.kielnet.net) has joined #tryton03:05
-!- JanGB(~jan@ip5f5ad17c.dynamic.kabel-deutschland.de) has joined #tryton05:15
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton05:55
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has joined #tryton07:59
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton08:00
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton08:06
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton08:11
-!- udono(~udono@167-060-210-188.ip-addr.inexio.net) has joined #tryton08:15
semarieon 5.0 (untested on tip), when closing tryton desktop client, I see INFO:trytond.security:logout for 'None' from '127.0.0.1' on database 'mydatabase1' in log. Shouldn't the username to be showed instead of 'None' ?08:36
semariethe other side (login) is: INFO:trytond.security:login succeeded for 'admin' from '127.0.0.1' on database 'mydatabase1'08:37
-!- rpit(~rpit@p4FD19D28.dip0.t-ipconnect.de) has joined #tryton08:40
cedksemarie: None is displayed when the session was already removed08:41
cedkbut it will be good to investigate if there are no two logout request and also I think the log message should be better in this case08:54
semarieI see only one logout message08:57
semariean option is to add user_id on logout (and login too)08:57
semarie  INFO trytond.security logout for 'None' (user_id=1) from '127.0.0.1' on database 'mydatabase1'08:58
semariethe information is directly available (it is a parameter on logout), and it is available on login too08:59
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton09:00
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton09:20
cedksemarie: I think it is good to have the information that logout request was not done because the session was not found09:21
semariecedk: I think there is a problem. here is my log (with --dev) : https://p.iotek.org/ad009:30
semariethe database is fresh (sqlite)09:30
semarieI connect using desktop, login, close the configuration tab for module, and close the desktop windows09:31
semarieI saw the entry in ir_session table09:31
semarieonce logout it is removed09:31
semariefrom the log, there is: DELETE FROM "ir_session" WHERE (("id" IN (6)))09:31
semarieand *after*, a SELECT for searching the session09:32
semarieonly one 'trytond.security' for logout (with None)09:32
semarie(and these test is on tip)09:32
semarie(and there is a little patch for showing user_id)09:33
semarieI have the same behaviour with sao and postgresql database when clicking on "logout" icon : "logout for 'None'"09:40
semariewith additionnal logging in ir.session, Session.remove() is called several times on logout09:55
cedksemarie: yes I foud that too10:00
semariebut trytond.security.logout() is called once.10:03
semarieit might be a problem with the for loop in logout()10:03
semarieif "name = Session.remove(session)" success, there is no break to avoid looping10:03
semarieso first time, name="admin" and session removed10:04
semarieand next, no more session and name=None10:04
semarieas the logger.info is after the loop, it showed 'None'10:04
cedksemarie: https://bugs.tryton.org/issue785210:05
semariecedk: the following diff is enough for calling Session.remove() once : https://p.iotek.org/dec10:07
semarieit doesn't address logger.error for None10:07
semarieah I missed the review10:08
semarieACTION look at the diff10:08
semariecedk: the "logout failed" message should be different as it isn't a logname that is used but a user_id. else if someone create a user with '1' as logname it will be confusing10:09
cedksemarie: this is free parameter from the caller so we should not care too much10:11
semariecedk: oh, and for login(), I think the break isn't necessary: there is already a break at end of the loop10:11
semarieoh, you removed it10:12
cedksemarie: yes I want to same pattern in all the metohds otherwise same issue will be happen again10:13
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton10:13
-!- csotelo(~csotelo@2800:200:f400:19c:2892:3d67:9264:7ff7) has joined #tryton11:06
-!- mariomop(~quassel@181.111.12.102) has joined #tryton11:10
pokolii've noticed the following exception on sentry: https://pastebin.com/zXaDi9KN any idea on how to fix it?11:23
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton11:59
-!- thaneor1(~lenovo3@179.26.229.45) has joined #tryton12:29
-!- JanGB(~jan@p54B05A67.dip0.t-ipconnect.de) has joined #tryton12:59
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton13:03
-!- nicoe(~nicoe@host-85-201-184-151.dynamic.voo.be) has joined #tryton13:07
-!- mrichez(~smuxi@mail.saluc.com) has joined #tryton13:28
-!- tafelgeschirr(~tafelgesc@5.104.149.54) has joined #tryton15:15
-!- mariomop(~quassel@181.111.12.102) has joined #tryton15:39
-!- lucascastro(~lucascast@177-185-139-186.isotelco.net.br) has joined #tryton16:09
-!- Seburath(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton16:14
-!- Sebu(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton17:34
-!- Seburath(bf649377@gateway/web/freenode/ip.191.100.147.119) has joined #tryton17:35
-!- udono(~udono@167-060-210-188.ip-addr.inexio.net) has joined #tryton18:24
-!- andrespoliti(~andrespol@200.50.173.5) has joined #tryton20:12
andrespolitigood afternoon20:12
andrespolitihow can i check the mimetype of a binary field? i'm trying to use the magic library like this:20:13
andrespolitimime = magic.Magic(mime=True)20:13
andrespolitireturn mime.from_buffer(buffer(dato.archivo))20:13
andrespolitibut it gives me an error: ArgumentError: argument 2: <type 'exceptions.TypeError'>: wrong type20:13
andrespolitii also tried without converting to buffer, and it gives me: TypeError: decoding bytearray is not supported20:14
-!- Timitos(~kpreisler@host-88-217-184-172.customer.m-online.net) has left #tryton20:28
cedkandrespoliti: what type is magic expecting?20:40
andrespolitimagic.from_buffer() Accepts a binary string20:40
andrespolitisorry, it's mime.from_buffer()20:41
cedkandrespoliti: there is no binary string in Python20:47
andrespolitithis is the example in the docstring of from_buffer: magic.from_buffer(open("testdata/test.pdf").read(1024))20:47
cedkandrespoliti: so it is string which is strange for pdf file20:53
andrespolitiis there any other way of checking the mimetype instead of using magic?20:54
cedkandrespoliti: the best is to be explicit so store it with data20:55
andrespolitii wanted to know the type to do a validation20:57
cedkandrespoliti: can not see what validation can be done on binary data20:59
-!- semarie(~semarie@unaffiliated/semarie) has joined #tryton21:01
andrespolitiI'm making an user configurable workflow system, and in each step they can configure required data. If the data is of type 'file', they can select the type of file (image, audio, pdf, etc)21:02
andrespolitithen, when the actual workflow is executed, the system would validate that the file they uploaded is of the correct mimetype21:03
-!- Seburath_(uid331224@gateway/web/irccloud.com/x-wlhijxvqkxijxxra) has joined #tryton21:31
cedkandrespoliti: I guess you should make a propose to implement filters on the binary widget22:09

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!