[issue35965] Behavior for unittest.assertRaisesRegex differs depending on whether it is used as a context manager

2019-02-11 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

On which Python versions do you see this problem? Both tests pass on my system 
(macOS 10.4.3) with Python 3.7.2, 3.6.3 and 3.5.5.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue35965] Behavior for unittest.assertRaisesRegex differs depending on whether it is used as a context manager

2019-02-11 Thread SylvainDe


New submission from SylvainDe :

On some Python versions, the following pieces of code have a different behavior 
which is not something I'd expect:

```

DESCRIPT_REQUIRES_TYPE_RE = r"descriptor '\w+' requires a 'set' object but 
received a 'int'"

...

def test_assertRaisesRegex(self):
self.assertRaisesRegex(TypeError, DESCRIPT_REQUIRES_TYPE_RE, set.add, 0)

def test_assertRaisesRegex_contextman(self):
with self.assertRaisesRegex(TypeError, DESCRIPT_REQUIRES_TYPE_RE):
set.add(0)

```

On impacted Python versions, only test_assertRaisesRegex_contextman fails while 
test_assertRaisesRegex works fine.

Logs for the failure:


```

==
FAIL: test_assertRaisesRegex_contextman 
(didyoumean_sugg_tests.SetAddIntRegexpTests)
--
TypeError: descriptor 'add' for 'set' objects doesn't apply to 'int' object
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/.../didyoumean/didyoumean_sugg_tests.py", line 23, 
in test_assertRaisesRegex_contextman
set.add(0)
AssertionError: "descriptor '\w+' requires a 'set' object but received a 'int'" 
does not match "descriptor 'add' for 'set' objects doesn't apply to 'int' 
object"


```


Either I am missing something or it looks like a bug to me.

If needed, more details/context can be found on the StackOverflow question I 
opened: 
https://stackoverflow.com/questions/54612348/different-error-message-when-unittest-assertraisesregex-is-called-as-a-context-m
 .
I can provide the details directly here if it is relevant.

--
components: Tests
messages: 335212
nosy: SylvainDe
priority: normal
severity: normal
status: open
title: Behavior for unittest.assertRaisesRegex differs depending on whether it 
is used as a context manager
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue35964] shutil.make_archive (xxx, tar, root_dir) is adding './' entry to archive which is wrong

2019-02-11 Thread HFM


New submission from HFM :

Running shutil.make_archive('a', 'tar', 'subdir') is created wrong and not 
really needed entry "./" which is visible in tarfile.Tarfile.list():

['./', 'foo/', 'hello.txt', 'foo/bar.txt']

I have tested and found this issue in the following versions of python:
2.7.15rc1  FOUND
3.6.7  FOUND
3.7.1  FOUND


I've attached a simple script which illustrates problem. Tested on Ubuntu Linux 
with mentioned python versions.

Similar issue has been fixed for 'zip' (https://bugs.python.org/issue28488) but 
exists for 'tar' archives.

--
components: Library (Lib)
files: tarfile_test.tar
messages: 335211
nosy: HFM, alanmcintyre, bialix, python-dev, serhiy.storchaka, tarek, twouters
priority: normal
severity: normal
status: open
title: shutil.make_archive (xxx, tar, root_dir) is adding './' entry to archive 
which is wrong
versions: Python 2.7, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48132/tarfile_test.tar

___
Python tracker 

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



[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2019-02-11 Thread miss-islington


miss-islington  added the comment:


New changeset 2259b5af3c711b40d2b81eacc1b5d75cda1ae3e2 by Miss Islington (bot) 
in branch '3.7':
[3.7] bpo-22062: Updated docstring and documentation for pathlib (GH-8519) 
(GH-11817)
https://github.com/python/cpython/commit/2259b5af3c711b40d2b81eacc1b5d75cda1ae3e2


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue18283] shutil.which() should support bytes

2019-02-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Would it be worthwhile to make a PR of this for 3.8?

Yes. Would you be interested to convert my old patch to a fresh PR? I can help 
you to work on that.

--

___
Python tracker 

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



[issue35960] dataclasses.field does not preserve empty metadata object

2019-02-11 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue35963] Python/symtable.c: warning: enumeration value ‘FunctionType_kind’ not handled in switch [-Wswitch]"

2019-02-11 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue35878] ast.c: end_col_offset may be used uninitialized in this function

2019-02-11 Thread STINNER Victor

STINNER Victor  added the comment:

Ivan Levkivskyi fixed the warning with commit 
181835d5a9bffee247bc2f7eefc778c1812bc982.

I created bpo-35963 Python/symtable.c: warning: enumeration value 
‘FunctionType_kind’ not handled in switch [-Wswitch]" for a remaining warning.

--

___
Python tracker 

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



[issue35963] Python/symtable.c: warning: enumeration value ‘FunctionType_kind’ not handled in switch [-Wswitch]"

2019-02-11 Thread STINNER Victor

New submission from STINNER Victor :

On x86 Gentoo Installed with X 3.x buildbot, there is a compiler warning:  

"Python/symtable.c:289:5: warning: enumeration value ‘FunctionType_kind’ not 
handled in switch [-Wswitch]"

https://buildbot.python.org/all/#/builders/103/builds/2067

It might me related to the implementation of the PEP 572 (bpo-35224), but I'm 
not sure.

See also bpo-35878.

--
components: Interpreter Core
messages: 335207
nosy: emilyemorehouse, levkivskyi, vstinner
priority: normal
severity: normal
status: open
title: Python/symtable.c: warning: enumeration value ‘FunctionType_kind’ not 
handled in switch [-Wswitch]"
versions: Python 3.8

___
Python tracker 

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



[issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME

2019-02-11 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2019-02-11 Thread miss-islington


miss-islington  added the comment:


New changeset 537b6caa565ec2fc304ba6f4400cd347ce2af64b by Miss Islington (bot) 
(Eivind Teig) in branch 'master':
bpo-22062: Updated docstring and documentation for pathlib (GH-8519)
https://github.com/python/cpython/commit/537b6caa565ec2fc304ba6f4400cd347ce2af64b


--
nosy: +miss-islington

___
Python tracker 

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



[issue35962] Slight error in words in [ 2.4.1. String and Bytes literals ]

2019-02-11 Thread Magnien Sebastien


New submission from Magnien Sebastien :

The documentation reads :

" The backslash (\) character is used to escape characters that otherwise have 
a special meaning, such as newline, backslash itself, or the quote character. "

However, 'n' does not "otherwise have a special meaning", nor does it represent 
a new line.

The backslash character does in fact do two different things :

1) It removes special meanings from characters that have one (\\).
2) It assigns a special meaning to normal characters (\n).

A better description would therefore be :

" The backslash (\) character is used to either escape characters that have a 
special meaning, such as backslash itself, or the quote character - or give 
special meaning to characters that do not have one, such as 'n', whose 
escapment '\n' means 'newline'. "

--
assignee: docs@python
components: Documentation
messages: 335205
nosy: Magnien Sebastien, docs@python
priority: normal
severity: normal
status: open
title: Slight error in words in [ 2.4.1. String and Bytes literals ]
type: enhancement
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue26024] Non-ascii Windows locale names

2019-02-11 Thread Vidar Fauske


Vidar Fauske  added the comment:

This issue can still be triggered for Python 3.7 by the following line (running 
on a Windows machine with a Norwegian locale as default):

locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())

--
versions: +Python 3.7

___
Python tracker 

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



[issue35953] crosscompilation fails with clang on android

2019-02-11 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

This problem has been fixed in python 3.7.

Most of the changes made to fix the problems of cross-building python for 
android have been done on python 3.7.

--

___
Python tracker 

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



[issue35460] Add PyDict_GetItemStringWithError

2019-02-11 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I can live without this API, I mostly filed this issue because there's an 
obvious hole in the API when you look at API description: SetItem, 
SetItemString, DelItem, DelItemString, GetItem, GetItemString, 
GetItemWithError, <>. 

Thanks for the explanations.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Stefan Krah


Stefan Krah  added the comment:

Yes, these days PRs are the only way to get anything done. Before
GitHub it would have been possible to just commit the small diff
directly to master.

--

___
Python tracker 

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



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

> If contributions are accepted as GitHub pull requests
these days, I can do it myself too.

GitHub pull requests are accepted. Please see https://devguide.python.org/ .

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Stefan Krah


Stefan Krah  added the comment:

The patch LGTM, but I'm not sure if we need to document __format__().
Personally I probably wouldn't.

--

___
Python tracker 

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



[issue23460] Decimals do not obey ':g' exponential notation formatting rules

2019-02-11 Thread Tuomas Suutari


Tuomas Suutari  added the comment:

> What is the status of this issue? I can submit a PR based on Tuomas Suutari's 
> patch.

Don't know more about the status, but nobody seemed to care to take my
patch forward. If contributions are accepted as GitHub pull requests
these days, I can do it myself too.

--

___
Python tracker 

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



<    1   2