GeospatialPython / pyshp

This library reads and writes ESRI Shapefiles in pure Python.
MIT License
1.09k stars 259 forks source link

Inconsistent line ending in files #278

Closed schwehr closed 6 days ago

schwehr commented 2 weeks ago

PyShp Version

head

Python Version

Any

Your code

Two related issues:

- changelog.txt, LICENSE.TXT and shapefile.py have DOS CRLF line endings while the others do not.
- LICENSE.TXT has `Non-ISO extended-ASCII text`. The current standard for the MIT license does not have these: https://spdx.org/licenses/MIT.html

Using the unix file command:

file --version
file-5.45
magic file from /etc/magic:/usr/share/misc/magic

file *

gives

changelog.txt:         ASCII text, with CRLF line terminators
LICENSE.TXT:           Non-ISO extended-ASCII text, with very long lines (458), with CRLF line terminators
MANIFEST.in:           ASCII text
__pycache__:           directory
pyproject.toml:        ASCII text
pytest.ini:            ASCII text
README.md:             Unicode text, UTF-8 text, with very long lines (1103)
requirements.test.txt: ASCII text
setup.cfg:             ASCII text
setup.py:              Python script, ASCII text executable
shapefile.py:          Python script, ASCII text executable, with CRLF line terminators
shapefiles:            directory
test_shapefile.py:     Python script, ASCII text executable

### Full stacktrace

```shell
None

Other notes

No response

JamesParrott commented 6 days ago

Fixed by e9a5fce, adding .gitattributes with * eol=crlf

ubuntu@Dev:/tmp$ git clone --depth=1 https://github.com/GeospatialPython/pyshp
git clone --depth=1 https://github.com/Geo
spatialPython/pyshp
Cloning into 'pyshp'...
remote: Enumerating objects: 81, done.
remote: Counting objects: 100% (81/81), done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 81 (delta 17), reused 47 (delta 4), pack-reused 0 (from 0)
Receiving objects: 100% (81/81), 2.02 MiB | 11.37 MiB/s, done.
Resolving deltas: 100% (17/17), done.
ubuntu@Dev:/tmp$
ubuntu@Dev:/tmp$ file pyshp/*
f
ile pyshp/*
pyshp/LICENSE.TXT:           Non-ISO extended-ASCII text, with very long lines (458), with CRLF line terminators
pyshp/MANIFEST.in:           ASCII text, with CRLF line terminators
pyshp/README.md:             Unicode text, UTF-8 text, with very long lines (1103), with CRLF line terminators
pyshp/changelog.txt:         ASCII text, with CRLF line terminators
pyshp/pyproject.toml:        ASCII text, with CRLF line terminators
pyshp/pytest.ini:            ASCII text, with CRLF line terminators
pyshp/requirements.test.txt: ASCII text, with CRLF line terminators
pyshp/setup.cfg:             Generic INItialization configuration [options]
pyshp/setup.py:              Python script, ASCII text executable, with CRLF line terminators
pyshp/shapefile.py:          Python script, ASCII text executable, with CRLF line terminators
pyshp/shapefiles:            directory
pyshp/test_shapefile.py:     Python script, ASCII text executable, with CRLF line terminators

(Apologies for the stdin repetition - I haven't worked out how to configure Fabric to make a nice repl yet. PRs welcome ;-) : https://github.com/JamesParrott/ssh_from_env)