)]}'
{"os_loganalyze/generator.py":[{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"b8ac0225d20c1f1879972c4a4bfce4a8da871f68","unresolved":false,"context_lines":[{"line_number":271,"context_line":"def get_file_generator(environ, root_path, config\u003dNone):"},{"line_number":272,"context_line":"    logname \u003d log_name(environ)"},{"line_number":273,"context_line":"    logpath \u003d safe_path(root_path, logname)"},{"line_number":274,"context_line":"    if logpath is None:"},{"line_number":275,"context_line":"        raise UnsafePath()"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    file_generator \u003d None"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_46f861c3","line":274,"updated":"2015-09-23 15:39:29.000000000","message":"(clarifying from irc)\n\nif logpath is an empty string, then:\n\n  if not logpath:\n\nis evaluated to true. However, if you hit http://log.o.o, at the top most directory it is possible to have an empty path. This check is therefore stricter to catch where no safe path was found (and hence None is returned)","commit_id":"e1079394e376885abc44d042aee8e554f809ae97"},{"author":{"_account_id":6316,"name":"Anita Kuno","email":"anteaya@anteaya.info","username":"anteaya"},"change_message_id":"ead15ad8262723533082509f6ff9a265804f8983","unresolved":false,"context_lines":[{"line_number":271,"context_line":"def get_file_generator(environ, root_path, config\u003dNone):"},{"line_number":272,"context_line":"    logname \u003d log_name(environ)"},{"line_number":273,"context_line":"    logpath \u003d safe_path(root_path, logname)"},{"line_number":274,"context_line":"    if logpath is None:"},{"line_number":275,"context_line":"        raise UnsafePath()"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    file_generator \u003d None"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_86d3d9d4","line":274,"in_reply_to":"ba15a1d1_46f861c3","updated":"2015-09-23 15:46:26.000000000","message":"Ah so the difference between true and None, thanks for clarifying for me.","commit_id":"e1079394e376885abc44d042aee8e554f809ae97"},{"author":{"_account_id":6316,"name":"Anita Kuno","email":"anteaya@anteaya.info","username":"anteaya"},"change_message_id":"5c53b1310135dbbd711e20f3285b8f3bf9477f4b","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        # NOTE(jhesketh): If the requested URL ends in a trailing slash we"},{"line_number":285,"context_line":"        # assume that this is meaning to load an index.html from our pseudo"},{"line_number":286,"context_line":"        # filesystem and attempt that first."},{"line_number":287,"context_line":"        if logname and logname[-1] \u003d\u003d \u0027/\u0027:"},{"line_number":288,"context_line":"            file_generator \u003d SwiftIterableBuffer("},{"line_number":289,"context_line":"                os.path.join(logname, \u0027index.html\u0027), config)"},{"line_number":290,"context_line":"            if not file_generator.obj:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_e8cf2354","line":287,"updated":"2015-09-23 00:36:32.000000000","message":"so we are testing the same variable twice?\n\n logname and logname","commit_id":"e1079394e376885abc44d042aee8e554f809ae97"},{"author":{"_account_id":6316,"name":"Anita Kuno","email":"anteaya@anteaya.info","username":"anteaya"},"change_message_id":"ead15ad8262723533082509f6ff9a265804f8983","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        # NOTE(jhesketh): If the requested URL ends in a trailing slash we"},{"line_number":285,"context_line":"        # assume that this is meaning to load an index.html from our pseudo"},{"line_number":286,"context_line":"        # filesystem and attempt that first."},{"line_number":287,"context_line":"        if logname and logname[-1] \u003d\u003d \u0027/\u0027:"},{"line_number":288,"context_line":"            file_generator \u003d SwiftIterableBuffer("},{"line_number":289,"context_line":"                os.path.join(logname, \u0027index.html\u0027), config)"},{"line_number":290,"context_line":"            if not file_generator.obj:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_e61df5be","line":287,"in_reply_to":"ba15a1d1_a6385da1","updated":"2015-09-23 15:46:26.000000000","message":"Ah thank you. Now I understand.","commit_id":"e1079394e376885abc44d042aee8e554f809ae97"},{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"b8ac0225d20c1f1879972c4a4bfce4a8da871f68","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        # NOTE(jhesketh): If the requested URL ends in a trailing slash we"},{"line_number":285,"context_line":"        # assume that this is meaning to load an index.html from our pseudo"},{"line_number":286,"context_line":"        # filesystem and attempt that first."},{"line_number":287,"context_line":"        if logname and logname[-1] \u003d\u003d \u0027/\u0027:"},{"line_number":288,"context_line":"            file_generator \u003d SwiftIterableBuffer("},{"line_number":289,"context_line":"                os.path.join(logname, \u0027index.html\u0027), config)"},{"line_number":290,"context_line":"            if not file_generator.obj:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_a6385da1","line":287,"in_reply_to":"ba15a1d1_e8cf2354","updated":"2015-09-23 15:39:29.000000000","message":"If logname is an empty string (eg \"\") then we can\u0027t look up -1 as the index won\u0027t exist. Like above, doing \u0027if logname\u0027 will check if the string is empty. If it is empty the second part of the condition is never tested so we avoid an index error. Otherwise if it isn\u0027t empty we can check the value of -1.","commit_id":"e1079394e376885abc44d042aee8e554f809ae97"}]}
