Skip to content

Commit

Permalink
Remove encoding comments from Ruby and Python (#3392)
Browse files Browse the repository at this point in the history
  • Loading branch information
externl authored Jan 21, 2025
1 parent 910ec57 commit 0447e5a
Show file tree
Hide file tree
Showing 56 changed files with 1 addition and 67 deletions.
5 changes: 0 additions & 5 deletions cpp/src/slice2py/Python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,6 @@ Slice::Python::compile(const vector<string>& argv)
}
FileTracker::instance()->addFile(path);

//
// Emit a Python magic comment to set the file encoding.
// It must be the first or second line.
//
out << "# -*- coding: utf-8 -*-\n";
printHeader(out);
printGeneratedHeader(out, base + ".ice", "#");

Expand Down
5 changes: 1 addition & 4 deletions cpp/src/slice2rb/Ruby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,7 @@ Slice::Ruby::compile(const vector<string>& argv)
throw FileException(__FILE__, __LINE__, oss.str());
}
FileTracker::instance()->addFile(file);
//
// Ruby magic comment to set the file encoding, it must be first or second line
//
out << "# encoding: utf-8\n";

printHeader(out);
printGeneratedHeader(out, base + ".ice", "#");

Expand Down
1 change: 0 additions & 1 deletion cpp/test/Glacier2/attack/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Glacier2Util import Glacier2TestSuite
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Glacier2/dynamicFiltering/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

#
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Glacier2/hashpassword/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import os
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Glacier2/sessionControl/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

#
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Glacier2/ssl/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Glacier2Util import Glacier2Router, Glacier2TestSuite
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Glacier2/staticFiltering/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import os
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Ice/logger/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import glob
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceBridge/simple/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from IceBridgeUtil import IceBridge
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/activation/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.
import os
import re
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/admin/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.


Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/allocation/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import os
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/deployer/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.


Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/fileLock/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.


Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/noRestartUpdate/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.


Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/replicaGroup/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import os
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/replication/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.


Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/session/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.


Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceGrid/update/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.


Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceStorm/federation/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.


Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceStorm/federation2/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

#
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceStorm/persistent/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from IceStormUtil import IceStorm, IceStormAdmin, IceStormProcess
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceStorm/rep1/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

#
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceStorm/repgrid/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

# Use the IceGridServer for the client because the client is an IceStorm subscriber and needs to be able
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceStorm/repstress/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

#
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceStorm/single/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

#
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceStorm/stress/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

#
Expand Down
1 change: 0 additions & 1 deletion cpp/test/IceUtil/unicode/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Util import ClientTestCase, SimpleClient, TestSuite
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Slice/errorDetection/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import glob
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Slice/headers/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import os
Expand Down
1 change: 0 additions & 1 deletion cpp/test/Slice/unicodePaths/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import os
Expand Down
5 changes: 0 additions & 5 deletions python/modules/IcePy/Slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,6 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args)
IceInternal::Output out(codeStream);
out.setUseTab(false);

//
// Emit a Python magic comment to set the file encoding.
// It must be the first or second line.
//
out << "# -*- coding: utf-8 -*-\n";
generate(u, all, includePaths, out);
u->destroy();

Expand Down
1 change: 0 additions & 1 deletion python/test/Ice/blobject/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

# This test doesn't support running with IceSSL, the Router object in the client process uses
Expand Down
1 change: 0 additions & 1 deletion python/test/Ice/properties/Client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import sys
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Glacier2/application.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Glacier2Util import Glacier2TestSuite
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Glacier2/router.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Glacier2Util import Glacier2Router, Glacier2TestSuite
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Glacier2/sessionHelper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Glacier2Util import Glacier2TestSuite
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/adapterDeactivation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Util import CSharpMapping, Darwin, TestSuite, platform, Mapping
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Util import TestSuite
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/ami.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

# Enable some tracing to allow investigating test failures
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/hold.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Util import ClientServerTestCase, Server, TestSuite
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Util import TestSuite
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/interrupt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Util import TestSuite
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/location.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

# Enable some tracing to allow investigating test failures
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/metrics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Util import (
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/operations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

# Enable some tracing to allow investigating test failures
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/properties.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from Util import Client, ClientTestCase, MatlabMapping, PhpMapping, TestSuite
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/retry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

# Enable some tracing to allow investigating test failures
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/Ice/timeout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

# Enable some tracing to allow investigating test failures
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/IceBox/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from IceBoxUtil import IceBox, IceBoxAdmin
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/IceBox/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from IceBoxUtil import IceBox
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/IceDiscovery/simple.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import re
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/IceGrid/simple.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import os
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/IceSSL/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

import os
Expand Down
1 change: 0 additions & 1 deletion scripts/tests/IceSSL/revocationutil.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) ZeroC, Inc.

from cryptography.hazmat.primitives import hashes, serialization
Expand Down

0 comments on commit 0447e5a

Please sign in to comment.