[issue44380] glob.glob handling of * (asterisk) wildcard is broken

2021-06-10 Thread Maxim Egorushkin


Maxim Egorushkin  added the comment:

> glob.glob does not provide something equivalent to a DOTALL flag 

I see now, said a blind man.

--

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



[issue44380] glob.glob handling of * (asterisk) wildcard is broken

2021-06-10 Thread Maxim Egorushkin


Maxim Egorushkin  added the comment:

I may be naive, but why then:

$ python3 -c 'from pathlib import Path; 
print(list(Path(".").glob("*.bash_profile")))'

Outputs:

[PosixPath('.bash_profile')]


?

--

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



[issue44380] glob.glob handling of * (asterisk) wildcard is broken

2021-06-10 Thread Maxim Egorushkin


Change by Maxim Egorushkin :


--
type:  -> behavior

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



[issue44380] glob.glob handling of * (asterisk) wildcard is broken

2021-06-10 Thread Maxim Egorushkin


New submission from Maxim Egorushkin :

Problem:

`glob.glob` documentation states that "pathname ... can contain shell-style 
wildcards." 

However, it stops short of saying that shell-style wildcards are handled the 
same way as in a POSIX-compliant/friendly shell.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13_02
 POSIX requires that "`*` (asterisk) is a pattern that shall match any string, 
including the null string."

However, `glob.glob` pattern `*` (asterisk) doesn't match an empty/null string. 

Reproduction:

$ ls *.bash_profile
.bash_profile
$ python3 -c 'import glob; print(glob.glob("*.bash_profile"))'
[]
$ python3 -c 'import glob; print(glob.glob(".bash_profile"))'
['.bash_profile']

--
components: Library (Lib)
messages: 395545
nosy: max0x7ba
priority: normal
severity: normal
status: open
title: glob.glob handling of * (asterisk) wildcard is broken
versions: Python 3.8

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



[issue7352] pythonx.y-config --ldflags out of /usr and missing -L

2015-10-07 Thread Maxim Egorushkin

Maxim Egorushkin added the comment:

I encountered this issue when compiling gdb against my own build of Python 2.7 
in a non-standard location. gdb could not locate libpython2.7.so.

The solution is to configure Python with LINKFORSHARED variable which contains 
additional linker flags required to link against libpython2.7.so. Here are the 
relevant bits (in Makefile syntax):

prefix := /opt/toolchain
python_version := 2.7.10
PREFIX := ${prefix}/python-${python_version}
CPPFLAGS := -fmessage-length=0
LINKFORSHARED := -L${PREFIX}/lib64 -Wl,-rpath=${PREFIX}/lib64

./configure --prefix=${PREFIX} --libdir=${PREFIX}/lib64 --enable-shared 
--enable-unicode=ucs4 CPPFLAGS="${cppflags}" LDFLAGS="${LDFLAGS}" 
LINKFORSHARED="${LINKFORSHARED}"

After Python is built and installed verify the flags:

$ /opt/toolchain/python-2.7.10/bin/python-config --ldflags
-lpython2.7 -lpthread -ldl -lutil -lm 
-L/opt/toolchain/python-2.7.10/lib64 
-Wl,-rpath=/opt/toolchain/python-2.7.10/lib64

--
nosy: +max0x7ba

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