[issue36426] exec() issue when used inside function
Domen Jurkovič added the comment: Are there any workarounds - how can we use exec() and on-the-fly created variables? Also, why 'locals()['bar']' is seen by the interpretter, but not ony 'bar'? -- ___ Python tracker <https://bugs.python.org/issue36426> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36426] exec() issue when used inside function
Domen Jurkovič added the comment: Seems like I don't know how to write a code here. Anyway, issue created on stack overflow can be found on: https://stackoverflow.com/questions/55239875/python-exec-function-broken-in-versions-above-2-7-error-name-not-defined/5524?noredirect=1#comment97362021_5524 Works on 2.7, fails on everything above 3.x -- ___ Python tracker <https://bugs.python.org/issue36426> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36426] exec() issue when used inside function
New submission from Domen Jurkovič : I've reported a stack overflow question and no reasonable explation was offered. Here is what I've discovered: .. code-block:: python def func(): varName = 'bar' varValue = 42 localVarToEvaluate = varName + ' = varValue' try: exec(localVarToEvaluate) except Exception as err: print(str(err)) if 'bar' in locals(): # print(locals()['bar']) # (1) OK # print(bar) # (2) ERR #print("'bar' OK:", bar) # (3) ERR pass # uncomment any line above func() After ``exec()`` is executed, ``bar`` can be seen in ``locals()``, but not accessible by intereter. Also, It can be accessed by directly calling ``print(locals()['bar'](``, but not ``print(bar)``. This is the problem as long as the code is wrapped in function. If the same code is placed in the module body, works as expected. Is there any exaplanation for such behaviour, or is this a bug? -- components: Interpreter Core, Windows messages: 338812 nosy: paul.moore, schperplata, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: exec() issue when used inside function type: behavior versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue36426> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11907] SysLogHandler can't send long messages
Domen Kožar added the comment: Note: same bug is relevant to DatagramHandler since it uses UDP transport. -- nosy: +iElectric ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11907 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7559] TestLoader.loadTestsFromName swallows import errors
Domen Kožar added the comment: Could we backport this one to 3.x and 2.7? It's leads to really bad UX. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7559 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7559] TestLoader.loadTestsFromName swallows import errors
Domen Kožar added the comment: One relevant use case is the following: https://github.com/Pylons/venusian/issues/23 Here the module is supposed to raise an ImportError. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7559] TestLoader.loadTestsFromName swallows import errors
Domen Kožar added the comment: What can I do to put this forward? It's still an issue in py2.7 -- nosy: +iElectric ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14621] Hash function is not randomized properly
Domen Kožar added the comment: According to talk at 29c3: http://events.ccc.de/congress/2012/Fahrplan/events/5152.en.html Quote: We also describe a vulnerability of Python's new randomized hash, allowing an attacker to easily recover the 128-bit secret seed. As a reliable fix to hash-flooding, we introduce SipHash, a family of cryptographically strong keyed hash function competitive in performance with the weak hashes, and already adopted in OpenDNS, Perl 5, Ruby, and in the Rust language. -- nosy: +iElectric ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16816] Bug in hash randomization
Domen Kožar added the comment: I believe this is not the case, I have updated example to use ordereddict, same effect: https://gist.github.com/4409304 -- resolution: invalid - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16816 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16816] Bug in hash randomization
Domen Kožar added the comment: That would mean there is a bug in OrderedDict, since iterator of item in OrderedDict should keep the order? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16816 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16816] Bug in hash randomization
Domen Kožar added the comment: Ah, works much better if you pass tuple to ordereddict. Seems like a bug in my program indeed (I was using ordereddict, but not correctly). Sorry for the noise! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16816 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16816] Bug in hash randomization
New submission from Domen Kožar: Script to reproduce the issue https://gist.github.com/4409304 -- components: Interpreter Core messages: 178539 nosy: iElectric priority: normal severity: normal status: open title: Bug in hash randomization type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16816 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12234] unittest2 could enable regex debugging for more information
Domen Kožar ielect...@gmail.com added the comment: I see, currently re module does not support debugging for matching a string. Even the upcoming new regex implementation does not support it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12234] unittest2 could enable regex debugging for more information
New submission from Domen Kožar ielect...@gmail.com: When using self.assertRegexpMatches, it would be useful to see where did the matching stop. Maybe using re module debugging flag? -- components: Library (Lib) messages: 137432 nosy: iElectric priority: normal severity: normal status: open title: unittest2 could enable regex debugging for more information type: feature request versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12234 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9077] argparse does not handle arguments correctly after --
Domen Kožar ielect...@gmail.com added the comment: I always used optparse like this, using the rargs (maybe this is not main intention, but worked so far): import optparse parser = optparse.OptionParser() parser.add_option('--test', action='store_true') Option at 0x7f55bdb32dd0: --test parser.parse_args(['--test', 'foo', 'foo1', '--', 'foo2', 'foo3']) (Values at 0x7f55bda89170: {'test': True}, ['foo', 'foo1', 'foo2', 'foo3']) parser.rargs ['foo2', 'foo3'] parser.largs ['foo', 'foo1'] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9077 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9077] argparse does not handle arguments correctly after --
Domen Kožar ielect...@gmail.com added the comment: I agree — not the best example, here is a better one explaining what behavior should not exist: parser = argparse.ArgumentParser() parser.add_argument('foobar', action='store') parser.add_argument('foobar2', nargs='?') parser.add_argument('foobar3', nargs='*') print parser.parse_args(['foo', '--', 'foo3', 'foo3']) Namespace(foobar='foo', foobar2='foo3', foobar3=['foo3']) I would expect both foo3 to be part of foobar3. This does not happen because of foobar2 argument eating zero or one argument. Arguments after -- should be left unparsed as such behavior was in optparse. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9077 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9077] argparse does not handle arguments correctly after --
Domen Kožar ielect...@gmail.com added the comment: Optparse behaved like that, how would one get the same results with argparse? That is by having variable positional parameters to command. And at the same time stop at --. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9077 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9077] argparse does not handle arguments correctly after --
New submission from Domen ielect...@gmail.com: Sample code: parser = argparse.ArgumentParser() parser.add_argument('-v', action='store_true') parser.add_argument('foo') parser.parse_args(['-v', '--', '--foo']) Namespace(foo='--foo', v=True) parser = argparse.ArgumentParser() parser.add_argument('-v', action='store_true') parser.parse_args(['--', '-f']) usage: [-h] [-v] : error: unrecognized arguments: -- -f -- components: Library (Lib) messages: 108567 nosy: iElectric priority: normal severity: normal status: open title: argparse does not handle arguments correctly after -- type: security versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9077 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8489] smtplib.SMTP.login() breaks with unicode input
New submission from Domen ielect...@gmail.com: Module smtplib, line 574, in login Module smtplib, line 538, in encode_cram_md5 Module hmac, line 72, in __init__ TypeError: character mapping must return integer, None or unicode Following traceback occurs when doing connection.login(u'foo...@domain.com', 'justdoit') to issue an ESMTP. Python 2.6.4 (r264:75706, Mar 11 2010, 18:33:18) -- components: Unicode messages: 103890 nosy: iElectric severity: normal status: open title: smtplib.SMTP.login() breaks with unicode input type: crash versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8489 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8489] smtplib.SMTP.login() breaks with unicode input
Domen ielect...@gmail.com added the comment: Plone currently just passes unicode data around, maybe additional documentation note will do for avoiding such trobules. Thanks for quick response. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8489 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2054] add ftp-tls support to ftplib - RFC 4217
Domen ielect...@gmail.com added the comment: Nice! Any chance of merging with 2.7? Python3.2 is waaay too far in future for such useful change to be actually useful. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2054 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5672] Implement a way to change the python process name
Changes by Domen ielect...@gmail.com: -- nosy: +iElectric ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2054] add ftp-tls support to ftplib - RFC 4217
Domen ielect...@gmail.com added the comment: What about AUTH SSL? Or is it too-deprecated? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2054 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2054] add ftp-tls support to ftplib - RFC 4217
Domen [EMAIL PROTECTED] added the comment: The lib should give programmer choice wether to send login through TLS or not. (as it is described in RFC 4217). Also, there should be an optional parameter to specify port for ftp connection. -- nosy: +iElectric __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2054 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com