[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-28 Thread Alex Shkop


Change by Alex Shkop :


--
keywords: +patch
pull_requests: +16041
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16459

___
Python tracker 
<https://bugs.python.org/issue38302>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-08-14 Thread Alex Shkop

Alex Shkop added the comment:

This is updated patch that doesn't alter warn_explicit behavior.

So the following:
simplefilter(ignore)
simplefilter(error, append=True)
simplefilter(ignore, append=True)

will ignore all warnings with this patch and no duplicates are inserted to 
warnings.filters. Also added a test for that case.

--
Added file: http://bugs.python.org/file40178/issue18383_34_2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-08-13 Thread Alex Shkop

Alex Shkop added the comment:

@rbcollins that is exactly what was trying to say in previous comment. We can 
make a change to current patch that won't affect behavior. In old API in this 
sequence of filters last filter was never used:

simplefilter(ignore)
simplefilter(error, append=True)
simplefilter(ignore, append=True)  # never used

So I suggest that new patch should work like this:


simplefilter(error)
simplefilter(ignore, append=True)  # appends new filter to the end

simplefilter(ignore)
simplefilter(error, append=True)
simplefilter(ignore, append=True)  # does nothing since same filter is 
present.

This way filtering will work in the same way it worked before patch and we 
won't have duplicates.

I'll update the patch as soon as I will get to my computer.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-07-31 Thread Alex Shkop

Alex Shkop added the comment:

Looking at this patch again, I'm wondering if it is correct to remove duplicate 
filter if append=True. Perhaps in this case it is more correct to leave the 
filter in place and do not append new one?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2015-05-12 Thread Alex Shkop

Alex Shkop added the comment:

Please, review the patch.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-05-12 Thread Alex Shkop

Alex Shkop added the comment:

Please, review the patch.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2015-04-29 Thread Alex Shkop

Alex Shkop added the comment:

Yes. That is how issue23882_find_all.patch works. I just removed hte condition

if (not namespace and
not os.path.isfile(os.path.join(full_path, '__init__.py'))):
return None, False
 
This makes namespace parameter redundant. Can I remove it?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2015-04-28 Thread Alex Shkop

Changes by Alex Shkop a.v.sh...@gmail.com:


Added file: http://bugs.python.org/file39223/issue23882_find_one_level.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2015-04-28 Thread Alex Shkop

Alex Shkop added the comment:

I'm still not sure which solution is the best. So I attach two simple patches.

First one enables full recursive scan of start_dir for namespace packages.

Second one loads tests only from top level namespace packages.

--
keywords: +patch
Added file: http://bugs.python.org/file39222/issue23882_find_all.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-28 Thread Alex Shkop

Alex Shkop added the comment:

*ping*

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2015-04-20 Thread Alex Shkop

Alex Shkop added the comment:

Thanks. I understand the code pretty well and I saw issue17457 that fixes 
discovery for explicitly specified namespace package.

What I need is to know how discovery has to work. Do we need to discover 
namespace packages inside discovery path? And should we do that recursively? 
I.e. should we pick namespace packages inside namespace packages? This will 
lead to recursive scan of all directories under discovery path.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery and namespaced packages

2015-04-20 Thread Alex Shkop

Alex Shkop added the comment:

This script creates following directory structure

issue_23882\
  tests\
test_fail.py

If you run from issue_23882 directory

python -m unittest

it doesn't find any tests. If there is __init__.py inside tests folder, same 
command finds test_fail.py and runs it.

I'm not sure yet about using pkgutil cause looks like iter_modules and 
walk_packages do not find namespace packages as well.

--
Added file: http://bugs.python.org/file39142/issue_23882_test_case.sh

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery and namespaced packages

2015-04-17 Thread Alex Shkop

Alex Shkop added the comment:

Not fully. Patch for issue17457 fixed discovery when you explicitly specified 
namespace package as a target for discovery. I.e. when you run

python -m unittest namespace_pkg

But it didn't recurse into any namespace packages inside namespace_pkg. So when 
you run

python -m unittest

it doesn't go under all namespace packages (basically folders) in cwd.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-14 Thread Alex Shkop

Alex Shkop added the comment:

Removed unnecessary assertWarns() contexts and fixed spelling errors.

--
Added file: 
http://bugs.python.org/file38982/issue18383_assert_warns_and_dups_v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-09 Thread Alex Shkop

Alex Shkop added the comment:

So, there are actually two issues, both of them causing the original warning. 

First issue was pointed out by Florent Xicluna. warnings.filterwarnings() 
method can create duplicates in warnings.filters.

Second issue is that assertWarns() works incorrectly in test_warnings.py due to 
use of import_fresh_module(). This produced original warning even without -Wd 
flag.

I attached a patch that fixes both issues for review. It includes a fix of 
previous patch, so no new warnings are produced. But perhaps we should separate 
these issues and create two patches.

--
Added file: 
http://bugs.python.org/file38876/issue18383_assert_warns_and_dups.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery and namespaced packages

2015-04-08 Thread Alex Shkop

Alex Shkop added the comment:

Spent some time looking into this one. Looks like the problem is in 
TestLoader.discover() method. There are couple of issues I found in it, all 
caused by same assumption.

Documentation [1] states that all test modules found by discover() method 
should be importable from top_level_dir. Whenever this method finds a 
subdirectory of start_dir it checks for __init__.py file. If there's no 
__init__.py then finder assumes that files within this package is not 
importable and stops recursion. This kind of 'importablity' check is not valid 
since we have namespace packages.

I'm not sure what should be done to fix this issue. We can change documentation 
to state that only regular packages with tests will be discovered. Or we can 
fix 'importability' checks, which will mean that all tests in all 
subdirectories will be discovered.

[1] 
https://docs.python.org/3.4/library/unittest.html#unittest.TestLoader.discover

--
nosy: +ashkop

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23577] Add tests for wsgiref.validate

2015-04-08 Thread Alex Shkop

Alex Shkop added the comment:

*ping*

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23577
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23811] Python py_compile error message inconsistent and missing newline

2015-04-07 Thread Alex Shkop

Alex Shkop added the comment:

This patch adds new line symbol. For some reason py_compile module prints only 
SyntaxErrors with traceback. All other exceptions are printed with Sorry: and 
in one line.

--
keywords: +patch
nosy: +ashkop
Added file: http://bugs.python.org/file38858/issue23811.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23811
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-06 Thread Alex Shkop

Alex Shkop added the comment:

When caller adds duplicate filter maybe we should promote his filter to the 
beginning of filters list? This feels more correct to me. So if user adds 
duplicate filter everything will work as if we added it.

--
Added file: 
http://bugs.python.org/file38841/issue18383_remove_dups_and_test.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22832] Tweak parameter names for fcntl module

2015-03-20 Thread Alex Shkop

Alex Shkop added the comment:

Fixed default values for fcntl(), ioctl() and lockf()

--
Added file: http://bugs.python.org/file38598/issue22832_v3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22832
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23645] Incorrect doc for __getslice__

2015-03-13 Thread Alex Shkop

Alex Shkop added the comment:

This is true. In ceval.c default value for end index is PY_SSIZE_T_MAX. Whereas 
in sysmodule.c defined:

SET_SYS_FROM_STRING(maxsize,
PyInt_FromSsize_t(PY_SSIZE_T_MAX));
SET_SYS_FROM_STRING(maxint,
PyInt_FromLong(PyInt_GetMax()));

I added a patch that fixes documentation. But please note, that __getslice__ is 
deprecated since Python 2.0 and is no longer supported in Python 3. Use 
__getitem__ instead.

--
keywords: +patch
nosy: +ashkop
Added file: http://bugs.python.org/file38468/issue23645.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23645
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23577] Add tests for wsgiref.validate

2015-03-03 Thread Alex Shkop

New submission from Alex Shkop:

These tests increase coverage of wsgiref.validate module. They test 
InputWrapper and ErrorWrapper used to validate env['wsgi.input'] and 
env['wsgi.errors'].

--
components: Tests
files: wsgiref_test_wrappers.patch
keywords: patch
messages: 237152
nosy: ashkop
priority: normal
severity: normal
status: open
title: Add tests for wsgiref.validate
versions: Python 3.5
Added file: http://bugs.python.org/file38321/wsgiref_test_wrappers.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23577
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-03-02 Thread Alex Shkop

Alex Shkop added the comment:

The issue occurs only if C implementation of _warnings is available. It is 
caused by re-use of global filters variable from _warnings when warnings is 
being re-imported.
So warnings modifies _warnings.filters on first import. Then, when you import 
warnings again it uses already modified version of _warnings.filters and adds 
same filter for the second time.

I attach a simple patch that prevents duplicates in filters. I'm not sure if 
this is a best way to fix the problem, but it works. It certainly affects 
performance of filterwarnings(), but there shouldn't be a lot of filters anyway.

Making filters a set() will solve the problem also, but will require API 
changes. Although I didn't find anywhere in documentation that warnings.filters 
should be a list, someone might rely on its .append() method.

--
nosy: +ashkop
Added file: http://bugs.python.org/file38301/issue18383_remove_dups.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18383
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22832] Tweak parameter names for fcntl module

2015-03-01 Thread Alex Shkop

Alex Shkop added the comment:

This patch fixes pointed out bugs in documentation and docstring for ioctl() 
function.

--
Added file: http://bugs.python.org/file38295/issue22832_v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22832
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23526] Silence resource warnings in test_httplib

2015-02-27 Thread Alex Shkop

Alex Shkop added the comment:

Thanks, great to hear.
I'm glad to help)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23526
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22832] Tweak parameter names for fcntl module

2015-02-27 Thread Alex Shkop

Alex Shkop added the comment:

Looks like default value for mutate_flag in ioctl() should be False. Docstring 
says:

If the argument is a mutable buffer and the mutable_flag argument is not
passed or is false, the behavior is as if a string had been passed.

Should I change the default value or the docstring?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22832
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22832] Tweak parameter names for fcntl module

2015-02-27 Thread Alex Shkop

Alex Shkop added the comment:

Docs say that mutate_flag is true by default since Python 2.5. Looks like I 
should fix the docstring.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22832
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22832] Tweak parameter names for fcntl module

2015-02-27 Thread Alex Shkop

Alex Shkop added the comment:

Created a patch. It renames arguments in clinic declarations and in documents. 
For lockf I've chosen Linux naming, because it really calls fcntl which has an 
argument called cmd, not function.

--
keywords: +patch
nosy: +ashkop
Added file: http://bugs.python.org/file38257/issue22832.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22832
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23527] test_smtpnet uses incorrect port for STARTTLS

2015-02-26 Thread Alex Shkop

New submission from Alex Shkop:

test_smtpnet uses port 25 for STARTTLS, whereas gmail exposes STARTTLS SMTP 
over port 587.

--
components: Tests
files: test_smtpnet_starttls_port.patch
keywords: patch
messages: 236658
nosy: ashkop
priority: normal
severity: normal
status: open
title: test_smtpnet uses incorrect port for STARTTLS
versions: Python 3.5
Added file: http://bugs.python.org/file38242/test_smtpnet_starttls_port.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23527
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22094] oss_audio_device.write(data) produces short writes

2015-02-25 Thread Alex Shkop

Alex Shkop added the comment:

It seems to me that OSS device doesn't accept more than SNDCTL_DSP_GETOSPACE. 
Looks like this depends on OSS version because OSS docs state that since 4.x 
one shouldn't use SNDCTL_DSP_GETOSPACE at all 
[http://manuals.opensound.com/developer/SNDCTL_DSP_GETOSPACE.html].

I have OSS 3.8.2 and I can reproduce the bug. Can someone with OSS = 4.0 
confirm that dsp.write() works as expected?

--
nosy: +ashkop

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22094
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23526] Silence resource warnings in test_httplib

2015-02-25 Thread Alex Shkop

New submission from Alex Shkop:

Three resource warnings are present in test_httplib.
Patch closes HTTPSConnection in test_networked_noverification, 
test_networked_trusted_by_default_cert, test_networked_good_cert.

--
components: Tests
files: test_httplib_warnings.patch
keywords: patch
messages: 236652
nosy: ashkop
priority: normal
severity: normal
status: open
title: Silence resource warnings in test_httplib
versions: Python 3.5
Added file: http://bugs.python.org/file38240/test_httplib_warnings.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23526
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23477] Increase coverage for wsgiref module

2015-02-20 Thread Alex Shkop

Alex Shkop added the comment:

Replaced %s;%s;%s with ';'.join() call.

--
Added file: http://bugs.python.org/file38184/wsgiref_test_environ_v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23477
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23477] Increase coverage for wsgiref module

2015-02-18 Thread Alex Shkop

New submission from Alex Shkop:

Added test for wssgiref.simple_server to check that environ argument contains 
correct headers, query string and path.

This code wasn't covered in tests previously.

--
components: Tests
files: wsgiref_test_environ.patch
keywords: patch
messages: 236176
nosy: ashkop
priority: normal
severity: normal
status: open
title: Increase coverage for wsgiref module
versions: Python 3.5
Added file: http://bugs.python.org/file38169/wsgiref_test_environ.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23477
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com