[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #27350 [Core Tor/Nyx]: Nyx -d ignores supplied file name
#27350: Nyx -d ignores supplied file name
--------------------------+------------------------------
Reporter: traumschule | Owner: atagar
Type: defect | Status: needs_review
Priority: Medium | Milestone:
Component: Core Tor/Nyx | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
--------------------------+------------------------------
Comment (by atagar):
Thanks traumschule.
[https://github.com/traumschule/nyx/commit/0a0735936bfdcd8bd13049ea1d87fd95a0b9f47d
That] isn't quite the fix I'll be going with but close.
In Python you should almost **never** use the **'is' keyword** since it
does object address comparisons. Under the covers Python does aggressive
object caching so 99% of the time it will seem to work, but occasionally
it won't. Often when you least expect it.
The only exception is None comparison. In that case ("if x is None") the
'is' keyword is suggested.
In python None, empty strings, and empty lists trustiness resolve to
'False' so the proper fix here is...
{{{
if debug_dir and not os.path.exists(debug_dir):
}}}
Sorry about the long explanation. Just seemed a good educational
opportunity. ;P
> stems output still appears on the screen
Sorry, I didn't understand this bit. Your fix corrected the stacktrace but
you got another error?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27350#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs